]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.nll.stderr
Auto merge of #57108 - Mark-Simulacrum:license-remove, r=pietroalbini
[rust.git] / src / test / ui / issues / issue-45696-scribble-on-boxed-borrow.nll.stderr
index 79a7c0631f4804ffca17f6cd553b4858b2ff0781..2cb07f0ad00136a6a6f3adf25d0dd4610f4a66b6 100644 (file)
@@ -1,47 +1,35 @@
 error[E0713]: borrow may still be in use when destructor runs
-  --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:63:5
+  --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:53:5
    |
+LL | fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 {
+   |              -- lifetime `'a` defined here
 LL |     &mut *s.0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
-   |     ^^^^^^^^^
+   |     ^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a`
 ...
 LL | }
    | - 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[E0713]: borrow may still be in use when destructor runs
-  --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:73:5
+  --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:64:5
    |
+LL | fn boxed_scribbled<'a>(s: Box<Scribble<'a>>) -> &'a mut u32 {
+   |                    -- lifetime `'a` defined here
 LL |     &mut *(*s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
-   |     ^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a`
 ...
 LL | }
    | - 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[E0713]: borrow may still be in use when destructor runs
-  --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:83:5
+  --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:75:5
    |
+LL | fn boxed_boxed_scribbled<'a>(s: Box<Box<Scribble<'a>>>) -> &'a mut u32 {
+   |                          -- lifetime `'a` defined here
 LL |     &mut *(**s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
-   |     ^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a`
 ...
 LL | }
    | - 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
-   |
-LL | fn boxed_boxed_scribbled<'a>(s: Box<Box<Scribble<'a>>>) -> &'a mut u32 {
-   |                          ^^
 
 error: aborting due to 3 previous errors