File tree Expand file tree Collapse file tree 6 files changed +43
-44
lines changed Expand file tree Collapse file tree 6 files changed +43
-44
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,9 @@ error[E0597]: borrowed value does not live long enough
22 --> $DIR/issue-47184.rs:14:44
33 |
44LL | 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
Original file line number Diff line number Diff line change @@ -55,6 +55,18 @@ LL | | }
5555LL | | }
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+
5870error[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 | | }
7688LL | | }
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-
9191error: aborting due to 6 previous errors
9292
9393For more information about this error, try `rustc --explain E0502`.
Original file line number Diff line number Diff line change 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...
77LL | }
@@ -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...
3131LL | }
Original file line number Diff line number Diff line change 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+ ...
77LL | }
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
2121LL | }
2222 | -
2323 | |
Original file line number Diff line number Diff line change 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...
77LL | }
@@ -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...
3131LL | }
Original file line number Diff line number Diff line change 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+ ...
77LL | }
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
1919LL | }
2020 | -
2121 | |
You can’t perform that action at this time.
0 commit comments