Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
issue-#45696: remove ignore-compare-mode-nll
  • Loading branch information
Centril committed Sep 26, 2019
commit 5a0e4613ce62f1e46f974af4065e5ccb3f56a1af
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
error[E0713]: borrow may still be in use when destructor runs
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:52:5
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:34:5
|
LL | fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 {
| -- lifetime `'a` defined here
LL | &mut *s.0
| ^^^^^^^^^ 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

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:39:5
|
LL | fn boxed_scribbled<'a>(s: Box<Scribble<'a>>) -> &'a mut u32 {
| -- lifetime `'a` defined here
LL | &mut *(*s).0
| ^^^^^^^^^^^^ 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

error[E0713]: borrow may still be in use when destructor runs
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:74:5
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:44:5
|
LL | fn boxed_boxed_scribbled<'a>(s: Box<Box<Scribble<'a>>>) -> &'a mut u32 {
| -- lifetime `'a` defined here
LL | &mut *(**s).0
| ^^^^^^^^^^^^^ 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

Expand Down
1 change: 0 additions & 1 deletion src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// mutable borrows that would be scribbled over by destructors before
// the return occurs.

// ignore-compare-mode-nll
// ignore-compare-mode-polonius

struct Scribble<'a>(&'a mut u32);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0713]: borrow may still be in use when destructor runs
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:35:5
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:34:5
|
LL | fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 {
| -- lifetime `'a` defined here
Expand All @@ -9,7 +9,7 @@ LL | }
| - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait

error[E0713]: borrow may still be in use when destructor runs
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:40:5
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:39:5
|
LL | fn boxed_scribbled<'a>(s: Box<Scribble<'a>>) -> &'a mut u32 {
| -- lifetime `'a` defined here
Expand All @@ -19,7 +19,7 @@ LL | }
| - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait

error[E0713]: borrow may still be in use when destructor runs
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:45:5
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:44:5
|
LL | fn boxed_boxed_scribbled<'a>(s: Box<Box<Scribble<'a>>>) -> &'a mut u32 {
| -- lifetime `'a` defined here
Expand Down