]> git.lizzy.rs Git - rust.git/blob - src/test/ui/error-codes/E0597.rs
Rollup merge of #97915 - tbu-:pr_os_string_fmt_write, r=joshtriplett
[rust.git] / src / test / ui / error-codes / E0597.rs
1 struct Foo<'a> {
2     x: Option<&'a u32>,
3 }
4
5 fn main() {
6     let mut x = Foo { x: None };
7     let y = 0;
8     x.x = Some(&y);
9     //~^ `y` does not live long enough [E0597]
10 }
11
12 impl<'a> Drop for Foo<'a> { fn drop(&mut self) { } }