summary refs log tree commit diff
path: root/src/test/ui/issue-17263.stderr
blob: 4767fbbcfbbd5bef522d859af12be3cf163810fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
error[E0499]: cannot borrow `x` (via `x.b`) as mutable more than once at a time
  --> $DIR/issue-17263.rs:17:34
   |
LL |     let (a, b) = (&mut x.a, &mut x.b);
   |                        ---       ^^^ second mutable borrow occurs here (via `x.b`)
   |                        |
   |                        first mutable borrow occurs here (via `x.a`)
...
LL | }
   | - first borrow ends here

error[E0502]: cannot borrow `foo` (via `foo.b`) as immutable because `foo` is also borrowed as mutable (via `foo.a`)
  --> $DIR/issue-17263.rs:21:32
   |
LL |     let (c, d) = (&mut foo.a, &foo.b);
   |                        -----   ^^^^^ immutable borrow occurs here (via `foo.b`)
   |                        |
   |                        mutable borrow occurs here (via `foo.a`)
LL |     //~^ ERROR cannot borrow `foo` (via `foo.b`) as immutable
LL | }
   | - mutable borrow ends here

error: aborting due to 2 previous errors

Some errors occurred: E0499, E0502.
For more information about an error, try `rustc --explain E0499`.