]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unique/unique-assign-drop.rs
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / unique / unique-assign-drop.rs
1 // run-pass
2 #![allow(unused_assignments)]
3
4 pub fn main() {
5     let i: Box<_> = Box::new(1);
6     let mut j: Box<_> = Box::new(2);
7     // Should drop the previous value of j
8     j = i;
9     assert_eq!(*j, 1);
10 }