rust/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-5.rs
2025-09-18 13:56:52 +02:00

14 lines
212 B
Rust

// Regression test for #91831
struct Foo<'a>(&'a i32);
impl<'a> Foo<'a> {
fn modify(&'a mut self) {}
}
fn bar(foo: &mut Foo) {
foo.modify(); //~ ERROR lifetime may not live long enough
}
fn main() {}