Skip to content

Commit 4c0f20f

Browse files
author
scott-linder
committed
Commit updated example stderr
1 parent 70194d5 commit 4c0f20f

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

clippy_lints/src/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ fn check_ty(cx: &LateContext, ast_ty: &Ty) {
183183
if let Some(def_id) = opt_def_id(def) {
184184
if Some(def_id) == cx.tcx.lang_items.owned_box() {
185185
if_let_chain! {[
186-
let &QPath::Resolved(None, ref path) = qpath,
186+
let QPath::Resolved(None, ref path) = *qpath,
187187
let [ref bx] = *path.segments,
188188
let PathParameters::AngleBracketedParameters(ref ab_data) = bx.parameters,
189189
let [ref inner] = *ab_data.types

clippy_tests/examples/borrow_box.stderr

+12-17
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
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+
|
87
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+
| ^^^^^^^^^^^^
1412

1513
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
2015
|
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`
2318

2419
error: aborting due to previous error(s)
2520

0 commit comments

Comments
 (0)