rust/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.rs
2023-01-11 09:32:08 +00:00

10 lines
207 B
Rust

struct Ref<'a, 'b> { a: &'a u32, b: &'b u32 }
fn foo(mut x: Ref, y: &u32) {
y = x.b;
//~^ ERROR lifetime may not live long enough
//~| ERROR cannot assign to immutable argument
}
fn main() { }