summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/needless_borrow.stderr
blob: e91b78b0a1520bb26cde7eb479efcb2e91f03434 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
error: this expression creates a reference which is immediately dereferenced by the compiler
  --> $DIR/needless_borrow.rs:15:15
   |
LL |     let _ = x(&&a); // warn
   |               ^^^ help: change this to: `&a`
   |
   = note: `-D clippy::needless-borrow` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::needless_borrow)]`

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> $DIR/needless_borrow.rs:19:13
   |
LL |     mut_ref(&mut &mut b); // warn
   |             ^^^^^^^^^^^ help: change this to: `&mut b`

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> $DIR/needless_borrow.rs:31:13
   |
LL |             &&a
   |             ^^^ help: change this to: `&a`

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> $DIR/needless_borrow.rs:33:15
   |
LL |         46 => &&a,
   |               ^^^ help: change this to: `&a`

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> $DIR/needless_borrow.rs:39:27
   |
LL |                     break &ref_a;
   |                           ^^^^^^ help: change this to: `ref_a`

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> $DIR/needless_borrow.rs:46:15
   |
LL |     let _ = x(&&&a);
   |               ^^^^ help: change this to: `&a`

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> $DIR/needless_borrow.rs:47:15
   |
LL |     let _ = x(&mut &&a);
   |               ^^^^^^^^ help: change this to: `&a`

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> $DIR/needless_borrow.rs:48:15
   |
LL |     let _ = x(&&&mut b);
   |               ^^^^^^^^ help: change this to: `&mut b`

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> $DIR/needless_borrow.rs:49:15
   |
LL |     let _ = x(&&ref_a);
   |               ^^^^^^^ help: change this to: `ref_a`

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> $DIR/needless_borrow.rs:52:11
   |
LL |         x(&b);
   |           ^^ help: change this to: `b`

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> $DIR/needless_borrow.rs:59:13
   |
LL |     mut_ref(&mut x);
   |             ^^^^^^ help: change this to: `x`

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> $DIR/needless_borrow.rs:60:13
   |
LL |     mut_ref(&mut &mut x);
   |             ^^^^^^^^^^^ help: change this to: `x`

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> $DIR/needless_borrow.rs:61:23
   |
LL |     let y: &mut i32 = &mut x;
   |                       ^^^^^^ help: change this to: `x`

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> $DIR/needless_borrow.rs:62:23
   |
LL |     let y: &mut i32 = &mut &mut x;
   |                       ^^^^^^^^^^^ help: change this to: `x`

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> $DIR/needless_borrow.rs:71:14
   |
LL |         0 => &mut x,
   |              ^^^^^^ help: change this to: `x`

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> $DIR/needless_borrow.rs:77:14
   |
LL |         0 => &mut x,
   |              ^^^^^^ help: change this to: `x`

error: this expression borrows a value the compiler would automatically borrow
  --> $DIR/needless_borrow.rs:89:13
   |
LL |     let _ = (&x).0;
   |             ^^^^ help: change this to: `x`

error: this expression borrows a value the compiler would automatically borrow
  --> $DIR/needless_borrow.rs:91:22
   |
LL |     let _ = unsafe { (&*x).0 };
   |                      ^^^^^ help: change this to: `(*x)`

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> $DIR/needless_borrow.rs:101:5
   |
LL |     (&&()).foo();
   |     ^^^^^^ help: change this to: `(&())`

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> $DIR/needless_borrow.rs:110:5
   |
LL |     (&&5).foo();
   |     ^^^^^ help: change this to: `(&5)`

error: this expression borrows a value the compiler would automatically borrow
  --> $DIR/needless_borrow.rs:175:13
   |
LL |             (&self.f)()
   |             ^^^^^^^^^ help: change this to: `(self.f)`

error: this expression borrows a value the compiler would automatically borrow
  --> $DIR/needless_borrow.rs:184:13
   |
LL |             (&mut self.f)()
   |             ^^^^^^^^^^^^^ help: change this to: `(self.f)`

error: aborting due to 22 previous errors