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