rust/tests/ui/error-codes/E0499.rs

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

11 lines
219 B
Rust
Raw Normal View History

fn main() {
2016-08-23 13:35:59 +00:00
let mut i = 0;
let mut x = &mut i;
let mut a = &mut i; //~ ERROR E0499
a.use_mut();
x.use_mut();
2016-08-23 13:35:59 +00:00
}
trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
impl<T> Fake for T { }