forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed
ignore-test-compare-mode-nll
from unboxed-closures tests
by strengthening the tests (by adding no-op references to the closures doing the borrows after the conflicting borrows, thus forcing the lifetimes to resemble lexical scopes even under NLL).
- Loading branch information
Showing
5 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
src/test/ui/unboxed-closures/unboxed-closure-region.nll.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
error[E0597]: `x` does not live long enough | ||
--> $DIR/unboxed-closure-region.rs:18:12 | ||
| | ||
LL | || x //~ ERROR `x` does not live long enough | ||
| -- ^ borrowed value does not live long enough | ||
| | | ||
| value captured here | ||
LL | }; | ||
| - `x` dropped here while still borrowed | ||
LL | _f; | ||
| -- borrow later used here | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0597`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/test/ui/unboxed-closures/unboxed-closures-borrow-conflict.nll.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
error[E0503]: cannot use `x` because it was mutably borrowed | ||
--> $DIR/unboxed-closures-borrow-conflict.rs:19:14 | ||
| | ||
LL | let f = || x += 1; | ||
| -- - borrow occurs due to use of `x` in closure | ||
| | | ||
| borrow of `x` occurs here | ||
LL | let _y = x; //~ ERROR cannot use `x` because it was mutably borrowed | ||
| ^ use of borrowed `x` | ||
LL | f; | ||
| - borrow later used here | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0503`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters