diff --git a/src/test/compile-fail/regions-static-bound.rs b/src/test/compile-fail/regions-static-bound.rs index de695e72d07e4bab6bb979e71d515313f4764bc8..9de8ca196f8ce9a021cf37d99607ec25da4f721a 100644 --- a/src/test/compile-fail/regions-static-bound.rs +++ b/src/test/compile-fail/regions-static-bound.rs @@ -8,17 +8,27 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// revisions: ll nll +//[nll] compile-flags: -Znll -Zborrowck=mir + fn static_id<'a,'b>(t: &'a ()) -> &'static () where 'a: 'static { t } fn static_id_indirect<'a,'b>(t: &'a ()) -> &'static () where 'a: 'b, 'b: 'static { t } fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a { - t //~ ERROR E0312 + t //[ll]~ ERROR E0312 + //[nll]~^ WARNING not reporting region error due to -Znll + //[nll]~| ERROR free region `'a` does not outlive free region `'static` } fn error(u: &(), v: &()) { - static_id(&u); //~ ERROR cannot infer an appropriate lifetime - static_id_indirect(&v); //~ ERROR cannot infer an appropriate lifetime + static_id(&u); //[ll]~ ERROR cannot infer an appropriate lifetime + //[nll]~^ WARNING not reporting region error due to -Znll + static_id_indirect(&v); //[ll]~ ERROR cannot infer an appropriate lifetime + //[nll]~^ WARNING not reporting region error due to -Znll + + // FIXME(#45827) -- MIR type checker shortcomings mean we don't + // see these errors (yet) in nll mode. } fn main() {} diff --git a/src/test/ui/nll/closure-requirements/region-ebr-does-not-outlive-static.rs b/src/test/ui/nll/closure-requirements/region-ebr-does-not-outlive-static.rs deleted file mode 100644 index fc8b48b85513480d4dc4ae6c6ca823fb1c40b4cf..0000000000000000000000000000000000000000 --- a/src/test/ui/nll/closure-requirements/region-ebr-does-not-outlive-static.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Basic test for free regions in the NLL code. This test ought to -// report an error due to a reborrowing constraint. Right now, we get -// a variety of errors from the older, AST-based machinery (notably -// borrowck), and then we get the NLL error at the end. - -// compile-flags:-Znll -Zborrowck=mir - -fn foo<'a>(x: &'a u32) -> &'static u32 - where 'static: 'a -{ - &*x - //~^ WARN not reporting region error due to -Znll - //~| ERROR free region `'a` does not outlive free region `'static` -} - -fn main() { } diff --git a/src/test/ui/nll/closure-requirements/region-ebr-does-not-outlive-static.stderr b/src/test/ui/nll/closure-requirements/region-ebr-does-not-outlive-static.stderr deleted file mode 100644 index d3fbbb81df92865c874f6992405e0e51641439a4..0000000000000000000000000000000000000000 --- a/src/test/ui/nll/closure-requirements/region-ebr-does-not-outlive-static.stderr +++ /dev/null @@ -1,14 +0,0 @@ -warning: not reporting region error due to -Znll - --> $DIR/region-ebr-does-not-outlive-static.rs:21:5 - | -21 | &*x - | ^^^ - -error: free region `'a` does not outlive free region `'static` - --> $DIR/region-ebr-does-not-outlive-static.rs:21:5 - | -21 | &*x - | ^^^ - -error: aborting due to previous error -