update test

This commit is contained in:
csmoe 2018-07-05 17:38:44 +08:00
parent 37228fe632
commit e7e8c72fdd
6 changed files with 53 additions and 54 deletions

View File

@ -2,10 +2,9 @@ error[E0597]: borrowed value does not live long enough
--> $DIR/issue-47184.rs:14:44 --> $DIR/issue-47184.rs:14:44
| |
LL | let _vec: Vec<&'static String> = vec![&String::new()]; LL | let _vec: Vec<&'static String> = vec![&String::new()];
| ^^^^^^^^^^^^^ temporary value does not live long enough | ^^^^^^^^^^^^^ - temporary value only lives until here
LL | //~^ ERROR borrowed value does not live long enough [E0597] | |
LL | } | temporary value does not live long enough
| - temporary value only lives until here
| |
= note: borrowed value must be valid for the static lifetime... = note: borrowed value must be valid for the static lifetime...

View File

@ -55,6 +55,18 @@ LL | | }
LL | | } LL | | }
| |_^ | |_^
error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir)
--> $DIR/get_default.rs:45:17
|
LL | match map.get() {
| --- immutable borrow occurs here
LL | Some(v) => {
LL | map.set(String::new()); // Both AST and MIR error here
| ^^^ mutable borrow occurs here
...
LL | return v;
| - borrow later used here
error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir) error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir)
--> $DIR/get_default.rs:51:17 --> $DIR/get_default.rs:51:17
| |
@ -76,18 +88,6 @@ LL | | }
LL | | } LL | | }
| |_^ | |_^
error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir)
--> $DIR/get_default.rs:45:17
|
LL | match map.get() {
| --- immutable borrow occurs here
LL | Some(v) => {
LL | map.set(String::new()); // Both AST and MIR error here
| ^^^ mutable borrow occurs here
...
LL | return v;
| - borrow later used here
error: aborting due to 6 previous errors error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0502`. For more information about this error, try `rustc --explain E0502`.

View File

@ -1,7 +1,7 @@
error[E0597]: `b1` does not live long enough error[E0597]: `b3` does not live long enough
--> $DIR/dropck_arr_cycle_checked.rs:111:24 --> $DIR/dropck_arr_cycle_checked.rs:105:24
| |
LL | b3.a[0].v.set(Some(&b1)); LL | b1.a[1].v.set(Some(&b3));
| ^^^ borrowed value does not live long enough | ^^^ borrowed value does not live long enough
... ...
LL | } LL | }
@ -22,10 +22,10 @@ LL | }
| borrowed value only lives until here | borrowed value only lives until here
| borrow later used here, when `b1` is dropped | borrow later used here, when `b1` is dropped
error[E0597]: `b3` does not live long enough error[E0597]: `b1` does not live long enough
--> $DIR/dropck_arr_cycle_checked.rs:105:24 --> $DIR/dropck_arr_cycle_checked.rs:111:24
| |
LL | b1.a[1].v.set(Some(&b3)); LL | b3.a[0].v.set(Some(&b1));
| ^^^ borrowed value does not live long enough | ^^^ borrowed value does not live long enough
... ...
LL | } LL | }

View File

@ -1,17 +1,3 @@
error[E0597]: `d1` does not live long enough
--> $DIR/dropck_direct_cycle_with_drop.rs:48:19
|
LL | d2.p.set(Some(&d1));
| ^^^ borrowed value does not live long enough
LL | //~^ ERROR `d1` does not live long enough
LL | }
| -
| |
| borrowed value only lives until here
| borrow later used here, when `d1` is dropped
|
= note: values in a scope are dropped in the opposite order they are defined
error[E0597]: `d2` does not live long enough error[E0597]: `d2` does not live long enough
--> $DIR/dropck_direct_cycle_with_drop.rs:46:19 --> $DIR/dropck_direct_cycle_with_drop.rs:46:19
| |
@ -26,6 +12,20 @@ LL | }
| |
= note: values in a scope are dropped in the opposite order they are defined = note: values in a scope are dropped in the opposite order they are defined
error[E0597]: `d1` does not live long enough
--> $DIR/dropck_direct_cycle_with_drop.rs:48:19
|
LL | d2.p.set(Some(&d1));
| ^^^ borrowed value does not live long enough
LL | //~^ ERROR `d1` does not live long enough
LL | }
| -
| |
| borrowed value only lives until here
| borrow later used here, when `d1` is dropped
|
= note: values in a scope are dropped in the opposite order they are defined
error: aborting due to 2 previous errors error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0597`. For more information about this error, try `rustc --explain E0597`.

View File

@ -1,7 +1,7 @@
error[E0597]: `c1` does not live long enough error[E0597]: `c3` does not live long enough
--> $DIR/dropck_vec_cycle_checked.rs:121:24 --> $DIR/dropck_vec_cycle_checked.rs:115:24
| |
LL | c3.v[0].v.set(Some(&c1)); LL | c1.v[1].v.set(Some(&c3));
| ^^^ borrowed value does not live long enough | ^^^ borrowed value does not live long enough
... ...
LL | } LL | }
@ -22,10 +22,10 @@ LL | }
| borrowed value only lives until here | borrowed value only lives until here
| borrow later used here, when `c1` is dropped | borrow later used here, when `c1` is dropped
error[E0597]: `c3` does not live long enough error[E0597]: `c1` does not live long enough
--> $DIR/dropck_vec_cycle_checked.rs:115:24 --> $DIR/dropck_vec_cycle_checked.rs:121:24
| |
LL | c1.v[1].v.set(Some(&c3)); LL | c3.v[0].v.set(Some(&c1));
| ^^^ borrowed value does not live long enough | ^^^ borrowed value does not live long enough
... ...
LL | } LL | }

View File

@ -1,15 +1,3 @@
error[E0597]: `c1` does not live long enough
--> $DIR/vec-must-not-hide-type-from-dropck.rs:129:24
|
LL | c2.v[0].v.set(Some(&c1));
| ^^^ borrowed value does not live long enough
LL | //~^ ERROR `c1` does not live long enough
LL | }
| -
| |
| borrowed value only lives until here
| borrow later used here, when `c1` is dropped
error[E0597]: `c2` does not live long enough error[E0597]: `c2` does not live long enough
--> $DIR/vec-must-not-hide-type-from-dropck.rs:127:24 --> $DIR/vec-must-not-hide-type-from-dropck.rs:127:24
| |
@ -22,6 +10,18 @@ LL | }
| borrowed value only lives until here | borrowed value only lives until here
| borrow later used here, when `c1` is dropped | borrow later used here, when `c1` is dropped
error[E0597]: `c1` does not live long enough
--> $DIR/vec-must-not-hide-type-from-dropck.rs:129:24
|
LL | c2.v[0].v.set(Some(&c1));
| ^^^ borrowed value does not live long enough
LL | //~^ ERROR `c1` does not live long enough
LL | }
| -
| |
| borrowed value only lives until here
| borrow later used here, when `c1` is dropped
error: aborting due to 2 previous errors error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0597`. For more information about this error, try `rustc --explain E0597`.