mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 20:54:13 +00:00
10 lines
220 B
Rust
10 lines
220 B
Rust
fn main() {
|
|
let mut value = 3;
|
|
let _borrow = &mut value;
|
|
let _sum = value + 1; //~ ERROR E0503
|
|
_borrow.use_mut();
|
|
}
|
|
|
|
trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
|
|
impl<T> Fake for T { }
|