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

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

13 lines
214 B
Rust
Raw Normal View History

2016-08-25 22:14:20 +00:00
fn bar(x: &mut i32) {}
fn foo(a: &mut i32) {
let ref y = a;
bar(a); //~ ERROR E0502
y.use_ref();
2016-08-25 22:14:20 +00:00
}
fn main() {
2016-08-25 22:14:20 +00:00
}
trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
impl<T> Fake for T { }