rust/tests/ui/span/issue-36537.rs

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

15 lines
229 B
Rust
Raw Normal View History

fn main() {
let p;
{
let a = 42;
p = &a;
//~^ ERROR `a` does not live long enough
}
p.use_ref();
}
trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
impl<T> Fake for T { }