rust/src/test/ui/span/regions-escape-loop-via-vec.stderr

42 lines
1.3 KiB
Plaintext
Raw Normal View History

2017-05-27 19:58:52 +02:00
error[E0597]: `z` does not live long enough
2018-12-25 08:56:47 -07:00
--> $DIR/regions-escape-loop-via-vec.rs:7:22
|
2018-02-23 03:42:32 +03:00
LL | _y.push(&mut z);
| ^ borrowed value does not live long enough
...
2018-02-23 03:42:32 +03:00
LL | }
| - `z` dropped here while still borrowed
2018-02-23 03:42:32 +03:00
LL | }
| - borrowed value needs to live until here
error[E0503]: cannot use `x` because it was mutably borrowed
2018-12-25 08:56:47 -07:00
--> $DIR/regions-escape-loop-via-vec.rs:5:11
|
2018-02-23 03:42:32 +03:00
LL | let mut _y = vec![&mut x];
| - borrow of `x` occurs here
2019-03-09 15:03:44 +03:00
LL | while x < 10 {
| ^ use of borrowed `x`
error[E0503]: cannot use `x` because it was mutably borrowed
2018-12-25 08:56:47 -07:00
--> $DIR/regions-escape-loop-via-vec.rs:6:13
|
2018-02-23 03:42:32 +03:00
LL | let mut _y = vec![&mut x];
| - borrow of `x` occurs here
2019-03-09 15:03:44 +03:00
LL | while x < 10 {
LL | let mut z = x;
| ^^^^^ use of borrowed `x`
error[E0506]: cannot assign to `x` because it is borrowed
2018-12-25 08:56:47 -07:00
--> $DIR/regions-escape-loop-via-vec.rs:9:9
|
2018-02-23 03:42:32 +03:00
LL | let mut _y = vec![&mut x];
| - borrow of `x` occurs here
...
2019-03-09 15:03:44 +03:00
LL | x += 1;
| ^^^^^^ assignment to borrowed `x` occurs here
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0503, E0506, E0597.
2018-03-03 15:59:40 +01:00
For more information about an error, try `rustc --explain E0503`.