// static inherent methods isn't quite working - need to
// fix that before removing the check.
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
trait Foo<'a, 'b, T>: Sized {
fn make_me() -> Self { loop {} }
fn static_evil(u: &'b u32) -> &'a u32;
fn make_me() -> Self { }
fn static_evil(u: &'b u32) -> &'a u32 {
u
- //[base]~^ ERROR E0312
- //[nll]~^^ ERROR lifetime may not live long enough
+ //~^ ERROR lifetime may not live long enough
}
}
fn make_me() -> Self { IndirectEvil(None) }
fn static_evil(u: &'b u32) -> &'a u32 {
let me = Self::make_me();
- //[base]~^ ERROR lifetime bound not satisfied
- //[nll]~^^ ERROR lifetime may not live long enough
+ //~^ ERROR lifetime may not live long enough
loop {} // (`me` could be used for the lifetime transmute).
}
}
impl<'a, 'b> Evil<'a, 'b> {
fn inherent_evil(u: &'b u32) -> &'a u32 {
u
- //[base]~^ ERROR E0312
- //[nll]~^^ ERROR lifetime may not live long enough
+ //~^ ERROR lifetime may not live long enough
}
}
fn evil<'a, 'b>(b: &'b u32) -> &'a u32 {
<()>::static_evil(b)
- //[base]~^ ERROR cannot infer an appropriate lifetime
- //[nll]~^^ ERROR lifetime may not live long enough
+ //~^ ERROR lifetime may not live long enough
}
fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
<IndirectEvil>::static_evil(b)
- //[base]~^ ERROR cannot infer an appropriate lifetime
- //[nll]~^^ ERROR lifetime may not live long enough
+ //~^ ERROR lifetime may not live long enough
}
fn inherent_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
<Evil>::inherent_evil(b)
- //[base]~^ ERROR cannot infer an appropriate lifetime
- //[nll]~^^ ERROR lifetime may not live long enough
+ //~^ ERROR lifetime may not live long enough
}