mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-24 21:53:56 +00:00
12 lines
226 B
Rust
12 lines
226 B
Rust
struct Ref<'a, T: 'a> {
|
|
data: &'a T
|
|
}
|
|
|
|
fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
|
|
let z = Ref { data: y.data };
|
|
x.push(z);
|
|
//~^ ERROR lifetime may not live long enough
|
|
}
|
|
|
|
fn main() { }
|