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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
157 B
Rust
Raw Normal View History

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