rust/tests/ui/lint/unused/lint-unused-mut-self.rs
2023-01-11 09:32:08 +00:00

15 lines
310 B
Rust

// 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() {}