Skip to content

Commit

Permalink
region-ebr-does-not-outlive-static: reuse old test instead
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Dec 7, 2017
1 parent b8e9eaf commit 75cf482
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 43 deletions.
16 changes: 13 additions & 3 deletions src/test/compile-fail/regions-static-bound.rs
Expand Up @@ -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() {}

This file was deleted.

This file was deleted.

0 comments on commit 75cf482

Please sign in to comment.