Update tests for changes to drop access
This commit is contained in:
parent
4603fb8862
commit
cfbd1a9a25
8 changed files with 26 additions and 10 deletions
|
|
@ -9,6 +9,8 @@ LL | }
|
|||
| |
|
||||
| `*cell` dropped here while still borrowed
|
||||
| borrow later used here, when `gen` is dropped
|
||||
|
|
||||
= note: values in a scope are dropped in the opposite order they are defined
|
||||
|
||||
error[E0597]: `ref_` does not live long enough
|
||||
--> $DIR/dropck.rs:22:11
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ LL | &mut *(*s).0 //[nll]~ ERROR borrow may still be in use when destructor
|
|||
| ^^^^^^^^^^^^
|
||||
...
|
||||
LL | }
|
||||
| - here, drop of `*s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
|
||||
| - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
|
||||
|
|
||||
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 72:20...
|
||||
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:72:20
|
||||
|
|
@ -41,7 +41,7 @@ LL | &mut *(**s).0 //[nll]~ ERROR borrow may still be in use when destructor
|
|||
| ^^^^^^^^^^^^^
|
||||
...
|
||||
LL | }
|
||||
| - here, drop of `**s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
|
||||
| - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
|
||||
|
|
||||
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 82:26...
|
||||
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:82:26
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ LL | &mut *(*s).0 //[nll]~ ERROR borrow may still be in use when destructor
|
|||
| ^^^^^^^^^^^^
|
||||
...
|
||||
LL | }
|
||||
| - here, drop of `*s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
|
||||
| - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
|
||||
|
|
||||
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 72:20...
|
||||
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:72:20
|
||||
|
|
@ -35,7 +35,7 @@ LL | &mut *(**s).0 //[nll]~ ERROR borrow may still be in use when destructor
|
|||
| ^^^^^^^^^^^^^
|
||||
...
|
||||
LL | }
|
||||
| - here, drop of `**s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
|
||||
| - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
|
||||
|
|
||||
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 82:26...
|
||||
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:82:26
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
error[E0713]: borrow may still be in use when destructor runs
|
||||
--> $DIR/borrowck-ref-into-rvalue.rs:14:14
|
||||
error[E0597]: borrowed value does not live long enough
|
||||
--> $DIR/borrowck-ref-into-rvalue.rs:13:11
|
||||
|
|
||||
LL | Some(ref m) => {
|
||||
| ^^^^^
|
||||
LL | match Some("Hello".to_string()) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
|
||||
...
|
||||
LL | }
|
||||
| - drop of temporary value occurs here
|
||||
| - temporary value only lives until here
|
||||
LL | println!("{}", *msg);
|
||||
| ---- borrow later used here
|
||||
|
|
||||
|
|
@ -13,4 +13,4 @@ LL | println!("{}", *msg);
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0713`.
|
||||
For more information about this error, try `rustc --explain E0597`.
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ LL | }
|
|||
| |
|
||||
| `b2` dropped here while still borrowed
|
||||
| borrow later used here, when `b1` is dropped
|
||||
|
|
||||
= note: values in a scope are dropped in the opposite order they are defined
|
||||
|
||||
error[E0597]: `b3` does not live long enough
|
||||
--> $DIR/dropck_arr_cycle_checked.rs:105:24
|
||||
|
|
@ -21,6 +23,8 @@ LL | }
|
|||
| |
|
||||
| `b3` dropped here while still borrowed
|
||||
| borrow later used here, when `b1` is dropped
|
||||
|
|
||||
= note: values in a scope are dropped in the opposite order they are defined
|
||||
|
||||
error[E0597]: `b1` does not live long enough
|
||||
--> $DIR/dropck_arr_cycle_checked.rs:111:24
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ LL | }
|
|||
| |
|
||||
| `c2` dropped here while still borrowed
|
||||
| borrow later used here, when `c1` is dropped
|
||||
|
|
||||
= note: values in a scope are dropped in the opposite order they are defined
|
||||
|
||||
error[E0597]: `c3` does not live long enough
|
||||
--> $DIR/dropck_vec_cycle_checked.rs:115:24
|
||||
|
|
@ -21,6 +23,8 @@ LL | }
|
|||
| |
|
||||
| `c3` dropped here while still borrowed
|
||||
| borrow later used here, when `c1` is dropped
|
||||
|
|
||||
= note: values in a scope are dropped in the opposite order they are defined
|
||||
|
||||
error[E0597]: `c1` does not live long enough
|
||||
--> $DIR/dropck_vec_cycle_checked.rs:121:24
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ LL | }
|
|||
| |
|
||||
| `x` dropped here while still borrowed
|
||||
| borrow later used here, when `y` is dropped
|
||||
|
|
||||
= note: values in a scope are dropped in the opposite order they are defined
|
||||
|
||||
error[E0597]: `x` does not live long enough
|
||||
--> $DIR/issue-29106.rs:33:25
|
||||
|
|
@ -19,6 +21,8 @@ LL | }
|
|||
| |
|
||||
| `x` dropped here while still borrowed
|
||||
| borrow later used here, when `y` is dropped
|
||||
|
|
||||
= note: values in a scope are dropped in the opposite order they are defined
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ LL | }
|
|||
| |
|
||||
| `c2` dropped here while still borrowed
|
||||
| borrow later used here, when `c1` is dropped
|
||||
|
|
||||
= note: values in a scope are dropped in the opposite order they are defined
|
||||
|
||||
error[E0597]: `c1` does not live long enough
|
||||
--> $DIR/vec-must-not-hide-type-from-dropck.rs:129:24
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue