rust/tests/run-pass/zst.rs

19 lines
237 B
Rust
Raw Normal View History

#[derive(PartialEq, Debug)]
2016-06-08 06:43:34 -05:00
struct A;
fn zst_ret() -> A {
A
}
fn use_zst() -> A {
let a = A;
a
}
fn main() {
assert_eq!(zst_ret(), A);
assert_eq!(use_zst(), A);
2016-09-22 08:47:16 -05:00
let x = 42 as *mut ();
unsafe { *x = (); }
}