diff --git a/clippy_tests/examples/borrow_box.rs b/clippy_tests/examples/borrow_box.rs index a72c664376f..ef569ab037f 100644 --- a/clippy_tests/examples/borrow_box.rs +++ b/clippy_tests/examples/borrow_box.rs @@ -18,6 +18,16 @@ struct Test3<'a> { foo: &'a Box } +trait Test4 { + fn test4(a: &Box); +} + +impl<'a> Test4 for Test3<'a> { + fn test4(a: &Box) { + unimplemented!(); + } +} + fn main(){ test1(&mut Box::new(false)); test2(); diff --git a/clippy_tests/examples/borrow_box.stderr b/clippy_tests/examples/borrow_box.stderr index 11838a0ec1c..6670a8c4083 100644 --- a/clippy_tests/examples/borrow_box.stderr +++ b/clippy_tests/examples/borrow_box.stderr @@ -22,6 +22,12 @@ error: you seem to be trying to use `&Box`. Consider using just `&T` 18 | foo: &'a Box | ^^^^^^^^^^^^^ help: try `&'a bool` +error: you seem to be trying to use `&Box`. Consider using just `&T` + --> borrow_box.rs:22:17 + | +22 | fn test4(a: &Box); + | ^^^^^^^^^^ help: try `&bool` + error: aborting due to previous error(s) error: Could not compile `clippy_tests`.