diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-09-06 15:47:50 +0200 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-09-26 06:44:57 +0200 |
| commit | 6ec9b3a0b6510fcac75bd60e5a317de7f29310ef (patch) | |
| tree | 5bdfdfa13066ad0b473b1d71205f38fc500f69a0 /src/test/ui/feature-gates | |
| parent | aff9c833e5a82307b79302c48ce2d245d56c3031 (diff) | |
| download | rust-6ec9b3a0b6510fcac75bd60e5a317de7f29310ef.tar.gz rust-6ec9b3a0b6510fcac75bd60e5a317de7f29310ef.zip | |
Adjust & --bless tests due to no longer downgrading NLL errors on 2015.
Diffstat (limited to 'src/test/ui/feature-gates')
| -rw-r--r-- | src/test/ui/feature-gates/feature-gate-nll.rs | 14 | ||||
| -rw-r--r-- | src/test/ui/feature-gates/feature-gate-nll.stderr | 20 |
2 files changed, 8 insertions, 26 deletions
diff --git a/src/test/ui/feature-gates/feature-gate-nll.rs b/src/test/ui/feature-gates/feature-gate-nll.rs index 8ec752409ab..fd6c5b67ef6 100644 --- a/src/test/ui/feature-gates/feature-gate-nll.rs +++ b/src/test/ui/feature-gates/feature-gate-nll.rs @@ -1,20 +1,18 @@ // There isn't a great way to test feature(nll), since it just disables migrate -// mode and changes some error messages. We just test for migrate mode. +// mode and changes some error messages. + +// FIXME(Centril): This test is probably obsolete now and `nll` should become +// `accepted`. // Don't use compare-mode=nll, since that turns on NLL. // ignore-compare-mode-nll // ignore-compare-mode-polonius -#![feature(rustc_attrs)] - -#[rustc_error] -fn main() { //~ ERROR compilation successful +fn main() { let mut x = (33, &0); let m = &mut x; let p = &*x.1; - //~^ WARNING cannot borrow - //~| WARNING this error has been downgraded to a warning - //~| WARNING this warning will become a hard error in the future + //~^ ERROR cannot borrow m; } diff --git a/src/test/ui/feature-gates/feature-gate-nll.stderr b/src/test/ui/feature-gates/feature-gate-nll.stderr index e5b28bbfa24..edfc22c32c9 100644 --- a/src/test/ui/feature-gates/feature-gate-nll.stderr +++ b/src/test/ui/feature-gates/feature-gate-nll.stderr @@ -1,29 +1,13 @@ -warning[E0502]: cannot borrow `*x.1` as immutable because it is also borrowed as mutable +error[E0502]: cannot borrow `*x.1` as immutable because it is also borrowed as mutable --> $DIR/feature-gate-nll.rs:15:13 | LL | let m = &mut x; | ------ mutable borrow occurs here LL | let p = &*x.1; | ^^^^^ immutable borrow occurs here -... +LL | LL | m; | - 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: compilation successful - --> $DIR/feature-gate-nll.rs:11:1 - | -LL | / fn main() { -LL | | let mut x = (33, &0); -LL | | -LL | | let m = &mut x; -... | -LL | | m; -LL | | } - | |_^ error: aborting due to previous error |
