]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/maybe-initialized-drop.rs
fix merge conflicts
[rust.git] / src / test / ui / nll / maybe-initialized-drop.rs
1 //compile-flags: -Zborrowck=mir
2
3 #![allow(warnings)]
4
5 struct Wrap<'p> { p: &'p mut i32 }
6
7 impl<'p> Drop for Wrap<'p> {
8     fn drop(&mut self) {
9         *self.p += 1;
10     }
11 }
12
13 fn main() {
14     let mut x = 0;
15     let wrap = Wrap { p: &mut x };
16     x = 1; //~ ERROR cannot assign to `x` because it is borrowed [E0506]
17 }