]> git.lizzy.rs Git - rust.git/blob - src/test/ui/hygiene/fields-numeric-borrowck.rs
Add 'compiler/rustc_codegen_gcc/' from commit 'afae271d5d3719eeb92c18bc004bb6d1965a5f3f'
[rust.git] / src / test / ui / hygiene / fields-numeric-borrowck.rs
1 struct S(u8);
2
3 fn main() {
4     let mut s = S(0);
5     let borrow1 = &mut s.0;
6     let S { 0: ref mut borrow2 } = s;
7     //~^ ERROR cannot borrow `s.0` as mutable more than once at a time
8     borrow2.use_mut();
9     borrow1.use_mut();
10 }
11
12 trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { }  }
13 impl<T> Fake for T { }