File tree 2 files changed +27
-2
lines changed
2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -1496,6 +1496,7 @@ impl LintPass for Stability {
1496
1496
fn check_expr ( & mut self , cx : & Context , e : & ast:: Expr ) {
1497
1497
// if the expression was produced by a macro expansion,
1498
1498
if e. span . expn_id != NO_EXPANSION { return }
1499
+ let mut span = e. span ;
1499
1500
1500
1501
let id = match e. node {
1501
1502
ast:: ExprPath ( ..) | ast:: ExprStruct ( ..) => {
@@ -1504,7 +1505,8 @@ impl LintPass for Stability {
1504
1505
None => return
1505
1506
}
1506
1507
}
1507
- ast:: ExprMethodCall ( ..) => {
1508
+ ast:: ExprMethodCall ( i, _, _) => {
1509
+ span = i. span ;
1508
1510
let method_call = typeck:: MethodCall :: expr ( e. id ) ;
1509
1511
match cx. tcx . method_map . borrow ( ) . find ( & method_call) {
1510
1512
Some ( method) => {
@@ -1561,7 +1563,7 @@ impl LintPass for Stability {
1561
1563
_ => format ! ( "use of {} item" , label)
1562
1564
} ;
1563
1565
1564
- cx. span_lint ( lint, e . span , msg. as_slice ( ) ) ;
1566
+ cx. span_lint ( lint, span, msg. as_slice ( ) ) ;
1565
1567
}
1566
1568
}
1567
1569
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ #![ deny( deprecated) ]
12
+
13
+ struct Foo ;
14
+
15
+ impl Foo {
16
+ #[ deprecated]
17
+ fn foo ( self ) { }
18
+ }
19
+
20
+ fn main ( ) {
21
+ Foo
22
+ . foo ( ) ; //~ ERROR use of deprecated item
23
+ }
You can’t perform that action at this time.
0 commit comments