diff options
Diffstat (limited to 'tests/ui/lint/unused/lint-unused-mut-self.rs')
| -rw-r--r-- | tests/ui/lint/unused/lint-unused-mut-self.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/lint/unused/lint-unused-mut-self.rs b/tests/ui/lint/unused/lint-unused-mut-self.rs new file mode 100644 index 00000000000..70736ce216e --- /dev/null +++ b/tests/ui/lint/unused/lint-unused-mut-self.rs @@ -0,0 +1,14 @@ +// run-rustfix + +#![allow(unused_assignments)] +#![allow(unused_variables)] +#![allow(dead_code)] +#![deny(unused_mut)] + +struct Foo; +impl Foo { + fn foo(mut self) {} //~ ERROR: variable does not need to be mutable + fn bar(mut self: Box<Foo>) {} //~ ERROR: variable does not need to be mutable +} + +fn main() {} |
