rust/tests/run-pass/specialization.rs
Scott Olson f9c1cfa889 Remove now-useless #[miri_run] attributes.
Except for `ints.rs`, which is already handled by a pending pull request.
2016-06-17 22:52:30 -06:00

20 lines
313 B
Rust

trait IsUnit {
fn is_unit() -> bool;
}
impl<T> IsUnit for T {
default fn is_unit() -> bool { false }
}
impl IsUnit for () {
fn is_unit() -> bool { true }
}
fn specialization() -> (bool, bool) {
(i32::is_unit(), <()>::is_unit())
}
fn main() {
assert_eq!(specialization(), (false, true));
}