rust/src/test/ui/issues/issue-26217.rs
2022-05-22 15:21:27 -04:00

16 lines
325 B
Rust

// revisions: base nll
// ignore-compare-mode-nll
//[nll] compile-flags: -Z borrowck=mir
fn foo<T>() where for<'a> T: 'a {}
fn bar<'a>() {
foo::<&'a i32>();
//[base]~^ ERROR the type `&'a i32` does not fulfill the required lifetime
//[nll]~^^ ERROR lifetime may not live long enough
}
fn main() {
bar();
}