]> git.lizzy.rs Git - rust.git/blob - src/test/ui/span/regions-escape-loop-via-vec.stderr
Auto merge of #60077 - RalfJung:miri-alloc-tests, r=joshtriplett
[rust.git] / src / test / ui / span / regions-escape-loop-via-vec.stderr
1 error[E0597]: `z` does not live long enough
2   --> $DIR/regions-escape-loop-via-vec.rs:7:22
3    |
4 LL |         _y.push(&mut z);
5    |                      ^ borrowed value does not live long enough
6 ...
7 LL |     }
8    |     - `z` dropped here while still borrowed
9 LL | }
10    | - borrowed value needs to live until here
11
12 error[E0503]: cannot use `x` because it was mutably borrowed
13   --> $DIR/regions-escape-loop-via-vec.rs:5:11
14    |
15 LL |     let mut _y = vec![&mut x];
16    |                            - borrow of `x` occurs here
17 LL |     while x < 10 {
18    |           ^ use of borrowed `x`
19
20 error[E0503]: cannot use `x` because it was mutably borrowed
21   --> $DIR/regions-escape-loop-via-vec.rs:6:13
22    |
23 LL |     let mut _y = vec![&mut x];
24    |                            - borrow of `x` occurs here
25 LL |     while x < 10 {
26 LL |         let mut z = x;
27    |             ^^^^^ use of borrowed `x`
28
29 error[E0506]: cannot assign to `x` because it is borrowed
30   --> $DIR/regions-escape-loop-via-vec.rs:9:9
31    |
32 LL |     let mut _y = vec![&mut x];
33    |                            - borrow of `x` occurs here
34 ...
35 LL |         x += 1;
36    |         ^^^^^^ assignment to borrowed `x` occurs here
37
38 error: aborting due to 4 previous errors
39
40 Some errors have detailed explanations: E0503, E0506, E0597.
41 For more information about an error, try `rustc --explain E0503`.