]> git.lizzy.rs Git - rust.git/blob - tests/ui/lint/noop-method-call.stderr
Auto merge of #106884 - clubby789:fieldless-enum-debug, r=michaelwoerister
[rust.git] / tests / ui / lint / noop-method-call.stderr
1 warning: call to `.clone()` on a reference in this situation does nothing
2   --> $DIR/noop-method-call.rs:16:71
3    |
4 LL |     let non_clone_type_ref_clone: &PlainType<u32> = non_clone_type_ref.clone();
5    |                                                                       ^^^^^^^^ unnecessary method call
6    |
7    = note: the type `&PlainType<u32>` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed
8 note: the lint level is defined here
9   --> $DIR/noop-method-call.rs:4:9
10    |
11 LL | #![warn(noop_method_call)]
12    |         ^^^^^^^^^^^^^^^^
13
14 warning: call to `.deref()` on a reference in this situation does nothing
15   --> $DIR/noop-method-call.rs:28:63
16    |
17 LL |     let non_deref_type_deref: &PlainType<u32> = non_deref_type.deref();
18    |                                                               ^^^^^^^^ unnecessary method call
19    |
20    = note: the type `&PlainType<u32>` which `deref` is being called on is the same as the type returned from `deref`, so the method call does not do anything and can be removed
21
22 warning: call to `.borrow()` on a reference in this situation does nothing
23   --> $DIR/noop-method-call.rs:36:66
24    |
25 LL |     let non_borrow_type_borrow: &PlainType<u32> = non_borrow_type.borrow();
26    |                                                                  ^^^^^^^^^ unnecessary method call
27    |
28    = note: the type `&PlainType<u32>` which `borrow` is being called on is the same as the type returned from `borrow`, so the method call does not do anything and can be removed
29
30 warning: call to `.clone()` on a reference in this situation does nothing
31   --> $DIR/noop-method-call.rs:48:19
32    |
33 LL |     non_clone_type.clone();
34    |                   ^^^^^^^^ unnecessary method call
35    |
36    = note: the type `&PlainType<T>` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed
37
38 warning: call to `.clone()` on a reference in this situation does nothing
39   --> $DIR/noop-method-call.rs:53:19
40    |
41 LL |     non_clone_type.clone();
42    |                   ^^^^^^^^ unnecessary method call
43    |
44    = note: the type `&PlainType<u32>` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed
45
46 warning: 5 warnings emitted
47