File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -21,19 +21,22 @@ impl<T> Deref for DerefExample<T> {
21
21
22
22
fn main ( ) {
23
23
let foo = & Foo ( 1u32 ) ;
24
- let foo_clone: & Foo < u32 > = foo. clone ( ) ; //~ WARNING call to method that does nothing [noop_method_call]
24
+ let foo_clone: & Foo < u32 > = foo. clone ( ) ;
25
+ //~^ WARNING call to method that does nothing [noop_method_call]
25
26
26
27
let bar = & Bar ( 1u32 ) ;
27
28
let bar_clone: Bar < u32 > = bar. clone ( ) ;
28
29
29
30
let deref = & & DerefExample ( 12u32 ) ;
30
- let derefed: & DerefExample < u32 > = deref. deref ( ) ; //~ WARNING call to method that does nothing [noop_method_call]
31
+ let derefed: & DerefExample < u32 > = deref. deref ( ) ;
32
+ //~^ WARNING call to method that does nothing [noop_method_call]
31
33
32
34
let deref = & DerefExample ( 12u32 ) ;
33
35
let derefed: & u32 = deref. deref ( ) ;
34
36
35
37
let a = & & Foo ( 1u32 ) ;
36
- let borrowed: & Foo < u32 > = a. borrow ( ) ; //~ WARNING call to method that does nothing [noop_method_call]
38
+ let borrowed: & Foo < u32 > = a. borrow ( ) ;
39
+ //~^ WARNING call to method that does nothing [noop_method_call]
37
40
}
38
41
39
42
fn generic < T > ( foo : & Foo < T > ) {
Original file line number Diff line number Diff line change @@ -7,19 +7,19 @@ LL | let foo_clone: &Foo<u32> = foo.clone();
7
7
= note: `#[warn(noop_method_call)]` on by default
8
8
9
9
warning: call to method that does nothing
10
- --> $DIR/noop-method-call.rs:30 :39
10
+ --> $DIR/noop-method-call.rs:31 :39
11
11
|
12
12
LL | let derefed: &DerefExample<u32> = deref.deref();
13
13
| ^^^^^^^^^^^^^ unnecessary method call
14
14
15
15
warning: call to method that does nothing
16
- --> $DIR/noop-method-call.rs:36 :31
16
+ --> $DIR/noop-method-call.rs:38 :31
17
17
|
18
18
LL | let borrowed: &Foo<u32> = a.borrow();
19
19
| ^^^^^^^^^^ unnecessary method call
20
20
21
21
warning: call to method that does nothing
22
- --> $DIR/noop-method-call.rs:44 :5
22
+ --> $DIR/noop-method-call.rs:47 :5
23
23
|
24
24
LL | foo.clone();
25
25
| ^^^^^^^^^^^ unnecessary method call
You can’t perform that action at this time.
0 commit comments