rust/tests/run-pass/zst.rs
Ralf Jung 1241938f97 test suite now also passes on MIR-libstd
Also enable some tests that were disabled for no apparant reason.
(The comment in zst.rs was wrong, the test was disabled also for miri execution.)
Delete env_args test as the args can actually be queried with MIR-libstd (currently, they are always empty)
2017-05-30 10:41:38 -07:00

21 lines
347 B
Rust

#[derive(PartialEq, Debug)]
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);
assert_eq!(&A as *const A as *const (), &() as *const _);
assert_eq!(&A as *const A, &A as *const A);
let x = 42 as *mut ();
unsafe { *x = (); }
}