]> git.lizzy.rs Git - rust.git/blob - src/test/ui/error-codes/E0597.rs
Merge commit 'd3a2366ee877075c59b38bd8ced55f224fc7ef51' into sync_cg_clif-2022-07-26
[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) { } }