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

12 lines
157 B
Rust
Raw Normal View History

2017-08-06 04:09:43 +05:30
struct Ref<'a, 'b> {
a: &'a u32,
b: &'b u32,
}
2017-08-06 04:09:43 +05:30
fn foo(mut x: Ref) {
2022-05-22 02:05:15 -04:00
x.a = x.b;
2022-04-01 13:13:25 -04:00
//~^ ERROR lifetime may not live long enough
}
2017-08-06 04:09:43 +05:30
2017-11-20 13:13:27 +01:00
fn main() {}