2022-05-22 02:05:15 -04:00
|
|
|
// revisions: base nll
|
|
|
|
|
// ignore-compare-mode-nll
|
|
|
|
|
//[nll] compile-flags: -Z borrowck=mir
|
|
|
|
|
|
2017-02-17 10:32:25 -05:00
|
|
|
struct Ref<'a, T: 'a> {
|
|
|
|
|
data: &'a T
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn foo(x: &mut Vec<Ref<i32>>, y: Ref<i32>) {
|
2022-05-22 02:05:15 -04:00
|
|
|
x.push(y);
|
|
|
|
|
//[base]~^ ERROR lifetime mismatch
|
|
|
|
|
//[nll]~^^ ERROR lifetime may not live long enough
|
2017-02-17 10:32:25 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() { }
|