about summary refs log tree commit diff
path: root/tests/ui/drop/box-drop-unused-value-statement-regression.rs
blob: 43865e084445799f6b54050096ac506eec6101ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//! Regression test for a crash caused by an "unsused move"
//! (specifically, a variable bound to a `Box` used as a statement)
//! leading to incorrect memory zero-filling after drop.
//!
//! Regression test for <https://github.com/rust-lang/rust/issues/3878>.

//@ run-pass

pub fn main() {
    let y: Box<_> = Box::new(1);
    drop(y);
}