rust/tests/ui/lint/unused/lint-unused-mut-self.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
310 B
Rust
Raw Normal View History

2020-07-02 14:32:12 +09:00
// run-rustfix
2014-10-27 15:37:07 -07:00
#![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() {}