forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#63565 - Centril:deny-nll-migrate-mode, r=ma…
…tthewjasper Rust 2018: NLL migrate mode => hard error As per decision on a language team meeting as described in rust-lang#63565 (comment), we refuse to downgrade NLL errors, that AST borrowck accepts, into warnings and keep them as hard errors. cc @rust-lang/lang cc @rust-lang/wg-compiler-nll
- Loading branch information
Showing
4 changed files
with
17 additions
and
13 deletions.
There are no files selected for viewing
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
13 changes: 6 additions & 7 deletions
13
src/test/ui/borrowck/borrowck-migrate-to-nll.edition.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 |
---|---|---|
@@ -1,15 +1,14 @@ | ||
warning[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable | ||
--> $DIR/borrowck-migrate-to-nll.rs:28:21 | ||
error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable | ||
--> $DIR/borrowck-migrate-to-nll.rs:29:21 | ||
| | ||
LL | let x = &mut block; | ||
| ---------- mutable borrow occurs here | ||
LL | let p: &'a u8 = &*block.current; | ||
| ^^^^^^^^^^^^^^^ immutable borrow occurs here | ||
LL | // (use `x` and `p` so enabling NLL doesn't assign overly short lifetimes) | ||
... | ||
LL | drop(x); | ||
| - mutable borrow later used here | ||
| | ||
= warning: this error has been downgraded to a warning for backwards compatibility with previous releases | ||
= warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future | ||
= note: for more information, try `rustc --explain E0729` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0502`. |
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