summaryrefslogtreecommitdiffstats
path: root/tests/ui/lint/noop-method-call.stderr
blob: 37cd1a0fc18eab7a2922d6e04f2d41b5edcce53d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
warning: call to `.clone()` on a reference in this situation does nothing
  --> $DIR/noop-method-call.rs:16:71
   |
LL |     let non_clone_type_ref_clone: &PlainType<u32> = non_clone_type_ref.clone();
   |                                                                       ^^^^^^^^ unnecessary method call
   |
   = 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
note: the lint level is defined here
  --> $DIR/noop-method-call.rs:4:9
   |
LL | #![warn(noop_method_call)]
   |         ^^^^^^^^^^^^^^^^

warning: using `.clone()` on a double reference, which returns `&CloneType<u32>` instead of cloning the inner type
  --> $DIR/noop-method-call.rs:23:63
   |
LL |     let clone_type_ref_clone: &CloneType<u32> = clone_type_ref.clone();
   |                                                               ^^^^^^^^
   |
   = note: `#[warn(suspicious_double_ref_op)]` on by default

warning: call to `.deref()` on a reference in this situation does nothing
  --> $DIR/noop-method-call.rs:27:63
   |
LL |     let non_deref_type_deref: &PlainType<u32> = non_deref_type.deref();
   |                                                               ^^^^^^^^ unnecessary method call
   |
   = 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

warning: using `.deref()` on a double reference, which returns `&PlainType<u32>` instead of dereferencing the inner type
  --> $DIR/noop-method-call.rs:31:63
   |
LL |     let non_deref_type_deref: &PlainType<u32> = non_deref_type.deref();
   |                                                               ^^^^^^^^

warning: call to `.borrow()` on a reference in this situation does nothing
  --> $DIR/noop-method-call.rs:35:66
   |
LL |     let non_borrow_type_borrow: &PlainType<u32> = non_borrow_type.borrow();
   |                                                                  ^^^^^^^^^ unnecessary method call
   |
   = 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

warning: using `.clone()` on a double reference, which returns `&str` instead of cloning the inner type
  --> $DIR/noop-method-call.rs:43:44
   |
LL |     let _v: Vec<&str> = xs.iter().map(|x| x.clone()).collect(); // could use `*x` instead
   |                                            ^^^^^^^^

warning: call to `.clone()` on a reference in this situation does nothing
  --> $DIR/noop-method-call.rs:48:19
   |
LL |     non_clone_type.clone();
   |                   ^^^^^^^^ unnecessary method call
   |
   = 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

warning: call to `.clone()` on a reference in this situation does nothing
  --> $DIR/noop-method-call.rs:53:19
   |
LL |     non_clone_type.clone();
   |                   ^^^^^^^^ unnecessary method call
   |
   = 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

warning: 8 warnings emitted