File tree 2 files changed +13
-18
lines changed
2 files changed +13
-18
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ fn check_ty(cx: &LateContext, ast_ty: &Ty) {
183
183
if let Some ( def_id) = opt_def_id ( def) {
184
184
if Some ( def_id) == cx. tcx . lang_items . owned_box ( ) {
185
185
if_let_chain ! { [
186
- let & QPath :: Resolved ( None , ref path) = qpath,
186
+ let QPath :: Resolved ( None , ref path) = * qpath,
187
187
let [ ref bx] = * path. segments,
188
188
let PathParameters :: AngleBracketedParameters ( ref ab_data) = bx. parameters,
189
189
let [ ref inner] = * ab_data. types
Original file line number Diff line number Diff line change 1
1
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
2
- --> borrow_box.rs:10:19
3
- |
4
- 10 | pub fn test1(foo: &Box<bool>) { //~ ERROR you seem to be trying to use `&Box<T>`
5
- | ^^^^^^^^^^
6
- |
7
- = note: #[deny(borrowed_box)] implied by #[deny(clippy)]
2
+ --> borrow_box.rs:9:19
3
+ |
4
+ 9 | pub fn test1(foo: &mut Box<bool>) {
5
+ | ^^^^^^^^^^^^^^ help: try `&mut bool`
6
+ |
8
7
note: lint level defined here
9
- --> borrow_box.rs:4:9
10
- |
11
- 4 | #![deny(clippy)]
12
- | ^^^^^^
13
- = help: replace `&Box<T>` with simply `&T`
8
+ --> borrow_box.rs:4:9
9
+ |
10
+ 4 | #![deny(borrowed_box)]
11
+ | ^^^^^^^^^^^^
14
12
15
13
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
16
- --> borrow_box.rs:19:10
17
- |
18
- 19 | foo: &'a Box<bool> //~ ERROR you seem to be trying to use `&Box<T>`
19
- | ^^^^^^^^^^^^^
14
+ --> borrow_box.rs:18:10
20
15
|
21
- = note: #[deny(borrowed_box)] implied by #[deny(clippy)]
22
- = help: replace `&Box<T>` with simply `&T `
16
+ 18 | foo: &'a Box<bool>
17
+ | ^^^^^^^^^^^^^ help: try `&'a bool `
23
18
24
19
error: aborting due to previous error(s)
25
20
You can’t perform that action at this time.
0 commit comments