rust/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.rs

12 lines
165 B
Rust
Raw Normal View History

2017-08-05 17:39:43 -05:00
struct Ref<'a, 'b> {
a: &'a u32,
b: &'b u32,
}
2017-08-05 17:39:43 -05:00
fn foo(mut x: Ref, y: Ref) {
2022-05-22 01:05:15 -05:00
x.b = y.b;
2022-04-01 12:13:25 -05:00
//~^ ERROR lifetime may not live long enough
}
2017-08-05 17:39:43 -05:00
fn main() {}