rust/src/test/ui/issue-54943.rs
Matthew Jasper 65fe251634 Handle lifetime annotations in unreachable code
We  equate the type in the annotation with the inferred type first so
that we have a fully inferred type to perform the well-formedness check
on.
2019-01-19 16:30:45 +00:00

14 lines
187 B
Rust

#![feature(nll)]
#![allow(warnings)]
fn foo<T: 'static>() { }
fn boo<'a>() {
return;
let x = foo::<&'a u32>();
//~^ ERROR lifetime may not live long enough
}
fn main() {}