-error[E0597]: `local.inner` does not live long enough
+error[E0713]: borrow may still be in use when destructor runs
--> $DIR/borrowck-fn-in-const-c.rs:27:16
|
LL | return &local.inner; //~ ERROR does not live long enough
- | ^^^^^^^^^^^^ borrowed value does not live long enough
+ | ^^^^^^^^^^^^
LL | }
- | - `local.inner` dropped here while still borrowed
+ | - here, drop of `local` needs exclusive access to `local.inner`, because the type `DropString` implements the `Drop` trait
|
= note: borrowed value must be valid for the static lifetime...
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0597`.
+For more information about this error, try `rustc --explain E0713`.
-warning[E0597]: `*s.0` does not live long enough
+warning[E0713]: borrow may still be in use when destructor runs
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:63:5
|
-LL | &mut *s.0 //[nll]~ ERROR `*s.0` does not live long enough [E0597]
- | ^^^^^^^^^ borrowed value does not live long enough
+LL | &mut *s.0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
+ | ^^^^^^^^^
...
LL | }
- | - `*s.0` dropped here while still borrowed
+ | - 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 62:14...
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:62:14
It represents potential unsoundness in your code.
This warning will become a hard error in the future.
-warning[E0597]: `*s.0` does not live long enough
+warning[E0713]: borrow may still be in use when destructor runs
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:73:5
|
-LL | &mut *(*s).0 //[nll]~ ERROR `*s.0` does not live long enough [E0597]
- | ^^^^^^^^^^^^ borrowed value does not live long enough
+LL | &mut *(*s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
+ | ^^^^^^^^^^^^
...
LL | }
- | - `*s.0` dropped here while still borrowed
+ | - 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
It represents potential unsoundness in your code.
This warning will become a hard error in the future.
-warning[E0597]: `*s.0` does not live long enough
+warning[E0713]: borrow may still be in use when destructor runs
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:83:5
|
-LL | &mut *(**s).0 //[nll]~ ERROR `*s.0` does not live long enough [E0597]
- | ^^^^^^^^^^^^^ borrowed value does not live long enough
+LL | &mut *(**s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
+ | ^^^^^^^^^^^^^
...
LL | }
- | - `*s.0` dropped here while still borrowed
+ | - 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
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0597`.
+For more information about this error, try `rustc --explain E0713`.
-error[E0597]: `*s.0` does not live long enough
+error[E0713]: borrow may still be in use when destructor runs
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:63:5
|
-LL | &mut *s.0 //[nll]~ ERROR `*s.0` does not live long enough [E0597]
- | ^^^^^^^^^ borrowed value does not live long enough
+LL | &mut *s.0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
+ | ^^^^^^^^^
...
LL | }
- | - `*s.0` dropped here while still borrowed
+ | - 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 62:14...
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:62:14
LL | fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 {
| ^^
-error[E0597]: `*s.0` does not live long enough
+error[E0713]: borrow may still be in use when destructor runs
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:73:5
|
-LL | &mut *(*s).0 //[nll]~ ERROR `*s.0` does not live long enough [E0597]
- | ^^^^^^^^^^^^ borrowed value does not live long enough
+LL | &mut *(*s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
+ | ^^^^^^^^^^^^
...
LL | }
- | - `*s.0` dropped here while still borrowed
+ | - 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
LL | fn boxed_scribbled<'a>(s: Box<Scribble<'a>>) -> &'a mut u32 {
| ^^
-error[E0597]: `*s.0` does not live long enough
+error[E0713]: borrow may still be in use when destructor runs
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:83:5
|
-LL | &mut *(**s).0 //[nll]~ ERROR `*s.0` does not live long enough [E0597]
- | ^^^^^^^^^^^^^ borrowed value does not live long enough
+LL | &mut *(**s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
+ | ^^^^^^^^^^^^^
...
LL | }
- | - `*s.0` dropped here while still borrowed
+ | - 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
error: aborting due to 3 previous errors
-For more information about this error, try `rustc --explain E0597`.
+For more information about this error, try `rustc --explain E0713`.
// this should be an error. (Which is perhaps the essence of why
// rust-lang/rust#45696 arose in the first place.)
fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 {
- &mut *s.0 //[nll]~ ERROR `*s.0` does not live long enough [E0597]
- //[migrate]~^ WARNING `*s.0` does not live long enough [E0597]
+ &mut *s.0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
+ //[migrate]~^ WARNING borrow may still be in use when destructor runs [E0713]
//[migrate]~| WARNING This error has been downgraded to a warning for backwards compatibility
}
// (But again, AST-borrowck was not smart enogh to know that this
// should be an error.)
fn boxed_scribbled<'a>(s: Box<Scribble<'a>>) -> &'a mut u32 {
- &mut *(*s).0 //[nll]~ ERROR `*s.0` does not live long enough [E0597]
- //[migrate]~^ WARNING `*s.0` does not live long enough [E0597]
+ &mut *(*s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
+ //[migrate]~^ WARNING borrow may still be in use when destructor runs [E0713]
//[migrate]~| WARNING This error has been downgraded to a warning for backwards compatibility
}
// (But again, AST-borrowck was not smart enogh to know that this
// should be an error.)
fn boxed_boxed_scribbled<'a>(s: Box<Box<Scribble<'a>>>) -> &'a mut u32 {
- &mut *(**s).0 //[nll]~ ERROR `*s.0` does not live long enough [E0597]
- //[migrate]~^ WARNING `*s.0` does not live long enough [E0597]
+ &mut *(**s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
+ //[migrate]~^ WARNING borrow may still be in use when destructor runs [E0713]
//[migrate]~| WARNING This error has been downgraded to a warning for backwards compatibility
}
struct S(Box<u32>);
fn get_dangling<'a>(v: VecWrapper<'a>) -> &'a u32 {
- let s_inner: &'a S = &*v.0; //~ ERROR `*v.0` does not live long enough
+ let s_inner: &'a S = &*v.0; //~ ERROR borrow may still be in use when destructor runs [E0713]
&s_inner.0
}
-error[E0597]: `*v.0` does not live long enough
+error[E0713]: borrow may still be in use when destructor runs
--> $DIR/issue-31567.rs:22:26
|
-LL | let s_inner: &'a S = &*v.0; //~ ERROR `*v.0` does not live long enough
- | ^^^^^ borrowed value does not live long enough
+LL | let s_inner: &'a S = &*v.0; //~ ERROR borrow may still be in use when destructor runs [E0713]
+ | ^^^^^
LL | &s_inner.0
LL | }
- | - `*v.0` dropped here while still borrowed
+ | - here, drop of `v` needs exclusive access to `*v.0`, because the type `VecWrapper<'_>` implements the `Drop` trait
|
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 21:17...
--> $DIR/issue-31567.rs:21:17
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0597`.
+For more information about this error, try `rustc --explain E0713`.
-error[E0597]: borrowed value does not live long enough
- --> $DIR/borrowck-ref-into-rvalue.rs:13:11
+error[E0713]: borrow may still be in use when destructor runs
+ --> $DIR/borrowck-ref-into-rvalue.rs:14:14
|
-LL | match Some("Hello".to_string()) {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
+LL | Some(ref m) => {
+ | ^^^^^
...
LL | }
- | - temporary value only lives until here
+ | - drop of temporary value occurs here
LL | println!("{}", *msg);
| ---- borrow later used here
|
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0597`.
+For more information about this error, try `rustc --explain E0713`.
-error[E0597]: `foo.data` does not live long enough
+error[E0713]: borrow may still be in use when destructor runs
--> $DIR/issue28498-reject-ex1.rs:44:29
|
LL | foo.data[0].1.set(Some(&foo.data[1]));
- | ^^^^^^^^ borrowed value does not live long enough
+ | ^^^^^^^^
...
LL | }
| -
| |
- | `foo.data` dropped here while still borrowed
+ | here, drop of `foo` needs exclusive access to `foo.data`, because the type `Foo<Concrete<'_>>` implements the `Drop` trait
| borrow later used here, when `foo` is dropped
|
+ = note: consider using a `let` binding to create a longer lived value
= note: values in a scope are dropped in the opposite order they are defined
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0597`.
+For more information about this error, try `rustc --explain E0713`.