Skip to content

Commit e7e8c72

Browse files
committed
update test
1 parent 37228fe commit e7e8c72

6 files changed

+43
-44
lines changed

src/test/ui/issue-47184.stderr

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ error[E0597]: borrowed value does not live long enough
22
--> $DIR/issue-47184.rs:14:44
33
|
44
LL | let _vec: Vec<&'static String> = vec![&String::new()];
5-
| ^^^^^^^^^^^^^ temporary value does not live long enough
6-
LL | //~^ ERROR borrowed value does not live long enough [E0597]
7-
LL | }
8-
| - temporary value only lives until here
5+
| ^^^^^^^^^^^^^ - temporary value only lives until here
6+
| |
7+
| temporary value does not live long enough
98
|
109
= note: borrowed value must be valid for the static lifetime...
1110

src/test/ui/nll/get_default.stderr

+12-12
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ LL | | }
5555
LL | | }
5656
| |_^
5757

58+
error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir)
59+
--> $DIR/get_default.rs:45:17
60+
|
61+
LL | match map.get() {
62+
| --- immutable borrow occurs here
63+
LL | Some(v) => {
64+
LL | map.set(String::new()); // Both AST and MIR error here
65+
| ^^^ mutable borrow occurs here
66+
...
67+
LL | return v;
68+
| - borrow later used here
69+
5870
error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir)
5971
--> $DIR/get_default.rs:51:17
6072
|
@@ -76,18 +88,6 @@ LL | | }
7688
LL | | }
7789
| |_^
7890

79-
error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir)
80-
--> $DIR/get_default.rs:45:17
81-
|
82-
LL | match map.get() {
83-
| --- immutable borrow occurs here
84-
LL | Some(v) => {
85-
LL | map.set(String::new()); // Both AST and MIR error here
86-
| ^^^ mutable borrow occurs here
87-
...
88-
LL | return v;
89-
| - borrow later used here
90-
9191
error: aborting due to 6 previous errors
9292

9393
For more information about this error, try `rustc --explain E0502`.

src/test/ui/span/dropck_arr_cycle_checked.nll.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
error[E0597]: `b1` does not live long enough
2-
--> $DIR/dropck_arr_cycle_checked.rs:111:24
1+
error[E0597]: `b3` does not live long enough
2+
--> $DIR/dropck_arr_cycle_checked.rs:105:24
33
|
4-
LL | b3.a[0].v.set(Some(&b1));
4+
LL | b1.a[1].v.set(Some(&b3));
55
| ^^^ borrowed value does not live long enough
66
...
77
LL | }
@@ -22,10 +22,10 @@ LL | }
2222
| borrowed value only lives until here
2323
| borrow later used here, when `b1` is dropped
2424

25-
error[E0597]: `b3` does not live long enough
26-
--> $DIR/dropck_arr_cycle_checked.rs:105:24
25+
error[E0597]: `b1` does not live long enough
26+
--> $DIR/dropck_arr_cycle_checked.rs:111:24
2727
|
28-
LL | b1.a[1].v.set(Some(&b3));
28+
LL | b3.a[0].v.set(Some(&b1));
2929
| ^^^ borrowed value does not live long enough
3030
...
3131
LL | }

src/test/ui/span/dropck_direct_cycle_with_drop.nll.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
error[E0597]: `d1` does not live long enough
2-
--> $DIR/dropck_direct_cycle_with_drop.rs:48:19
1+
error[E0597]: `d2` does not live long enough
2+
--> $DIR/dropck_direct_cycle_with_drop.rs:46:19
33
|
4-
LL | d2.p.set(Some(&d1));
4+
LL | d1.p.set(Some(&d2));
55
| ^^^ borrowed value does not live long enough
6-
LL | //~^ ERROR `d1` does not live long enough
6+
...
77
LL | }
88
| -
99
| |
@@ -12,12 +12,12 @@ LL | }
1212
|
1313
= note: values in a scope are dropped in the opposite order they are defined
1414

15-
error[E0597]: `d2` does not live long enough
16-
--> $DIR/dropck_direct_cycle_with_drop.rs:46:19
15+
error[E0597]: `d1` does not live long enough
16+
--> $DIR/dropck_direct_cycle_with_drop.rs:48:19
1717
|
18-
LL | d1.p.set(Some(&d2));
18+
LL | d2.p.set(Some(&d1));
1919
| ^^^ borrowed value does not live long enough
20-
...
20+
LL | //~^ ERROR `d1` does not live long enough
2121
LL | }
2222
| -
2323
| |

src/test/ui/span/dropck_vec_cycle_checked.nll.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
error[E0597]: `c1` does not live long enough
2-
--> $DIR/dropck_vec_cycle_checked.rs:121:24
1+
error[E0597]: `c3` does not live long enough
2+
--> $DIR/dropck_vec_cycle_checked.rs:115:24
33
|
4-
LL | c3.v[0].v.set(Some(&c1));
4+
LL | c1.v[1].v.set(Some(&c3));
55
| ^^^ borrowed value does not live long enough
66
...
77
LL | }
@@ -22,10 +22,10 @@ LL | }
2222
| borrowed value only lives until here
2323
| borrow later used here, when `c1` is dropped
2424

25-
error[E0597]: `c3` does not live long enough
26-
--> $DIR/dropck_vec_cycle_checked.rs:115:24
25+
error[E0597]: `c1` does not live long enough
26+
--> $DIR/dropck_vec_cycle_checked.rs:121:24
2727
|
28-
LL | c1.v[1].v.set(Some(&c3));
28+
LL | c3.v[0].v.set(Some(&c1));
2929
| ^^^ borrowed value does not live long enough
3030
...
3131
LL | }

src/test/ui/span/vec-must-not-hide-type-from-dropck.nll.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
error[E0597]: `c1` does not live long enough
2-
--> $DIR/vec-must-not-hide-type-from-dropck.rs:129:24
1+
error[E0597]: `c2` does not live long enough
2+
--> $DIR/vec-must-not-hide-type-from-dropck.rs:127:24
33
|
4-
LL | c2.v[0].v.set(Some(&c1));
4+
LL | c1.v[0].v.set(Some(&c2));
55
| ^^^ borrowed value does not live long enough
6-
LL | //~^ ERROR `c1` does not live long enough
6+
...
77
LL | }
88
| -
99
| |
1010
| borrowed value only lives until here
1111
| borrow later used here, when `c1` is dropped
1212

13-
error[E0597]: `c2` does not live long enough
14-
--> $DIR/vec-must-not-hide-type-from-dropck.rs:127:24
13+
error[E0597]: `c1` does not live long enough
14+
--> $DIR/vec-must-not-hide-type-from-dropck.rs:129:24
1515
|
16-
LL | c1.v[0].v.set(Some(&c2));
16+
LL | c2.v[0].v.set(Some(&c1));
1717
| ^^^ borrowed value does not live long enough
18-
...
18+
LL | //~^ ERROR `c1` does not live long enough
1919
LL | }
2020
| -
2121
| |

0 commit comments

Comments
 (0)