mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
16 lines
325 B
Rust
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();
|
|
}
|