]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-17263.stderr
Rollup merge of #53213 - tmccombs:stable-ipconstructors, r=KodrAus
[rust.git] / src / test / ui / issues / issue-17263.stderr
1 error[E0499]: cannot borrow `x` (via `x.b`) as mutable more than once at a time
2   --> $DIR/issue-17263.rs:17:34
3    |
4 LL |     let (a, b) = (&mut x.a, &mut x.b);
5    |                        ---       ^^^ second mutable borrow occurs here (via `x.b`)
6    |                        |
7    |                        first mutable borrow occurs here (via `x.a`)
8 ...
9 LL | }
10    | - first borrow ends here
11
12 error[E0502]: cannot borrow `foo` (via `foo.b`) as immutable because `foo` is also borrowed as mutable (via `foo.a`)
13   --> $DIR/issue-17263.rs:21:32
14    |
15 LL |     let (c, d) = (&mut foo.a, &foo.b);
16    |                        -----   ^^^^^ immutable borrow occurs here (via `foo.b`)
17    |                        |
18    |                        mutable borrow occurs here (via `foo.a`)
19 LL |     //~^ ERROR cannot borrow `foo` (via `foo.b`) as immutable
20 LL | }
21    | - mutable borrow ends here
22
23 error: aborting due to 2 previous errors
24
25 Some errors occurred: E0499, E0502.
26 For more information about an error, try `rustc --explain E0499`.