11error: this expression creates a reference which is immediately dereferenced by the compiler
2- --> tests/ui/needless_borrow.rs:16 :15
2+ --> tests/ui/needless_borrow.rs:12 :15
33 |
44LL | let _ = x(&&a); // warn
55 | ^^^ help: change this to: `&a`
@@ -8,163 +8,163 @@ LL | let _ = x(&&a); // warn
88 = help: to override `-D warnings` add `#[allow(clippy::needless_borrow)]`
99
1010error: this expression creates a reference which is immediately dereferenced by the compiler
11- --> tests/ui/needless_borrow.rs:22 :13
11+ --> tests/ui/needless_borrow.rs:18 :13
1212 |
1313LL | mut_ref(&mut &mut b); // warn
1414 | ^^^^^^^^^^^ help: change this to: `&mut b`
1515
1616error: this expression creates a reference which is immediately dereferenced by the compiler
17- --> tests/ui/needless_borrow.rs:36 :13
17+ --> tests/ui/needless_borrow.rs:32 :13
1818 |
1919LL | &&a
2020 | ^^^ help: change this to: `&a`
2121
2222error: this expression creates a reference which is immediately dereferenced by the compiler
23- --> tests/ui/needless_borrow.rs:39 :15
23+ --> tests/ui/needless_borrow.rs:35 :15
2424 |
2525LL | 46 => &&a,
2626 | ^^^ help: change this to: `&a`
2727
2828error: this expression creates a reference which is immediately dereferenced by the compiler
29- --> tests/ui/needless_borrow.rs:46 :27
29+ --> tests/ui/needless_borrow.rs:42 :27
3030 |
3131LL | break &ref_a;
3232 | ^^^^^^ help: change this to: `ref_a`
3333
3434error: this expression creates a reference which is immediately dereferenced by the compiler
35- --> tests/ui/needless_borrow.rs:54 :15
35+ --> tests/ui/needless_borrow.rs:50 :15
3636 |
3737LL | let _ = x(&&&a);
3838 | ^^^^ help: change this to: `&a`
3939
4040error: this expression creates a reference which is immediately dereferenced by the compiler
41- --> tests/ui/needless_borrow.rs:56 :15
41+ --> tests/ui/needless_borrow.rs:52 :15
4242 |
4343LL | let _ = x(&mut &&a);
4444 | ^^^^^^^^ help: change this to: `&a`
4545
4646error: this expression creates a reference which is immediately dereferenced by the compiler
47- --> tests/ui/needless_borrow.rs:58 :15
47+ --> tests/ui/needless_borrow.rs:54 :15
4848 |
4949LL | let _ = x(&&&mut b);
5050 | ^^^^^^^^ help: change this to: `&mut b`
5151
5252error: this expression creates a reference which is immediately dereferenced by the compiler
53- --> tests/ui/needless_borrow.rs:60 :15
53+ --> tests/ui/needless_borrow.rs:56 :15
5454 |
5555LL | let _ = x(&&ref_a);
5656 | ^^^^^^^ help: change this to: `ref_a`
5757
5858error: this expression creates a reference which is immediately dereferenced by the compiler
59- --> tests/ui/needless_borrow.rs:64 :11
59+ --> tests/ui/needless_borrow.rs:60 :11
6060 |
6161LL | x(&b);
6262 | ^^ help: change this to: `b`
6363
6464error: this expression creates a reference which is immediately dereferenced by the compiler
65- --> tests/ui/needless_borrow.rs:72 :13
65+ --> tests/ui/needless_borrow.rs:68 :13
6666 |
6767LL | mut_ref(&mut x);
6868 | ^^^^^^ help: change this to: `x`
6969
7070error: this expression creates a reference which is immediately dereferenced by the compiler
71- --> tests/ui/needless_borrow.rs:74 :13
71+ --> tests/ui/needless_borrow.rs:70 :13
7272 |
7373LL | mut_ref(&mut &mut x);
7474 | ^^^^^^^^^^^ help: change this to: `x`
7575
7676error: this expression creates a reference which is immediately dereferenced by the compiler
77- --> tests/ui/needless_borrow.rs:76 :23
77+ --> tests/ui/needless_borrow.rs:72 :23
7878 |
7979LL | let y: &mut i32 = &mut x;
8080 | ^^^^^^ help: change this to: `x`
8181
8282error: this expression creates a reference which is immediately dereferenced by the compiler
83- --> tests/ui/needless_borrow.rs:78 :23
83+ --> tests/ui/needless_borrow.rs:74 :23
8484 |
8585LL | let y: &mut i32 = &mut &mut x;
8686 | ^^^^^^^^^^^ help: change this to: `x`
8787
8888error: this expression creates a reference which is immediately dereferenced by the compiler
89- --> tests/ui/needless_borrow.rs:88 :14
89+ --> tests/ui/needless_borrow.rs:84 :14
9090 |
9191LL | 0 => &mut x,
9292 | ^^^^^^ help: change this to: `x`
9393
9494error: this expression creates a reference which is immediately dereferenced by the compiler
95- --> tests/ui/needless_borrow.rs:95 :14
95+ --> tests/ui/needless_borrow.rs:91 :14
9696 |
9797LL | 0 => &mut x,
9898 | ^^^^^^ help: change this to: `x`
9999
100100error: this expression borrows a value the compiler would automatically borrow
101- --> tests/ui/needless_borrow.rs:108 :13
101+ --> tests/ui/needless_borrow.rs:104 :13
102102 |
103103LL | let _ = (&x).0;
104104 | ^^^^ help: change this to: `x`
105105
106106error: this expression creates a reference which is immediately dereferenced by the compiler
107- --> tests/ui/needless_borrow.rs:119 :5
107+ --> tests/ui/needless_borrow.rs:115 :5
108108 |
109109LL | (&&()).foo();
110110 | ^^^^^^ help: change this to: `(&())`
111111
112112error: this expression creates a reference which is immediately dereferenced by the compiler
113- --> tests/ui/needless_borrow.rs:129 :5
113+ --> tests/ui/needless_borrow.rs:125 :5
114114 |
115115LL | (&&5).foo();
116116 | ^^^^^ help: change this to: `(&5)`
117117
118118error: this expression creates a reference which is immediately dereferenced by the compiler
119- --> tests/ui/needless_borrow.rs:156 :23
119+ --> tests/ui/needless_borrow.rs:152 :23
120120 |
121121LL | let x: (&str,) = (&"",);
122122 | ^^^ help: change this to: `""`
123123
124124error: this expression borrows a value the compiler would automatically borrow
125- --> tests/ui/needless_borrow.rs:199 :13
125+ --> tests/ui/needless_borrow.rs:195 :13
126126 |
127127LL | (&self.f)()
128128 | ^^^^^^^^^ help: change this to: `(self.f)`
129129
130130error: this expression borrows a value the compiler would automatically borrow
131- --> tests/ui/needless_borrow.rs:209 :13
131+ --> tests/ui/needless_borrow.rs:205 :13
132132 |
133133LL | (&mut self.f)()
134134 | ^^^^^^^^^^^^^ help: change this to: `(self.f)`
135135
136136error: this expression borrows a value the compiler would automatically borrow
137- --> tests/ui/needless_borrow.rs:247 :22
137+ --> tests/ui/needless_borrow.rs:243 :22
138138 |
139139LL | let _ = &mut (&mut { x.u }).x;
140140 | ^^^^^^^^^^^^^^ help: change this to: `{ x.u }`
141141
142142error: this expression borrows a value the compiler would automatically borrow
143- --> tests/ui/needless_borrow.rs:255 :22
143+ --> tests/ui/needless_borrow.rs:251 :22
144144 |
145145LL | let _ = &mut (&mut { x.u }).x;
146146 | ^^^^^^^^^^^^^^ help: change this to: `{ x.u }`
147147
148148error: this expression borrows a value the compiler would automatically borrow
149- --> tests/ui/needless_borrow.rs:260 :22
149+ --> tests/ui/needless_borrow.rs:256 :22
150150 |
151151LL | let _ = &mut (&mut x.u).x;
152152 | ^^^^^^^^^^ help: change this to: `x.u`
153153
154154error: this expression borrows a value the compiler would automatically borrow
155- --> tests/ui/needless_borrow.rs:262 :22
155+ --> tests/ui/needless_borrow.rs:258 :22
156156 |
157157LL | let _ = &mut (&mut { x.u }).x;
158158 | ^^^^^^^^^^^^^^ help: change this to: `{ x.u }`
159159
160160error: this expression creates a reference which is immediately dereferenced by the compiler
161- --> tests/ui/needless_borrow.rs:284 :23
161+ --> tests/ui/needless_borrow.rs:280 :23
162162 |
163163LL | option.unwrap_or((&x.0,));
164164 | ^^^^ help: change this to: `x.0`
165165
166166error: this expression creates a reference which is immediately dereferenced by the compiler
167- --> tests/ui/needless_borrow.rs:291 :13
167+ --> tests/ui/needless_borrow.rs:287 :13
168168 |
169169LL | let _ = (&slice).len();
170170 | ^^^^^^^^ help: change this to: `slice`
0 commit comments