]> git.lizzy.rs Git - rust.git/blob - src/test/ui/methods/method-self-arg-2.stderr
move an `assert!` to the right place
[rust.git] / src / test / ui / methods / method-self-arg-2.stderr
1 error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
2   --> $DIR/method-self-arg-2.rs:15:14
3    |
4 LL |     let y = &mut x;
5    |             ------ mutable borrow occurs here
6 LL |     Foo::bar(&x);
7    |              ^^ immutable borrow occurs here
8 LL |     y.use_mut();
9    |     ----------- mutable borrow later used here
10
11 error[E0499]: cannot borrow `x` as mutable more than once at a time
12   --> $DIR/method-self-arg-2.rs:20:14
13    |
14 LL |     let y = &mut x;
15    |             ------ first mutable borrow occurs here
16 LL |     Foo::baz(&mut x);
17    |              ^^^^^^ second mutable borrow occurs here
18 LL |     y.use_mut();
19    |     ----------- first borrow later used here
20
21 error: aborting due to 2 previous errors
22
23 Some errors have detailed explanations: E0499, E0502.
24 For more information about an error, try `rustc --explain E0499`.