rust/test/specialization.rs
2016-03-28 17:59:48 -06:00

20 lines
348 B
Rust
Executable File

#![feature(custom_attribute, specialization)]
#![allow(dead_code, unused_attributes)]
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 }
}
#[miri_run]
fn specialization() -> (bool, bool) {
(i32::is_unit(), <()>::is_unit())
}