diff --git a/test/specialization.rs b/test/specialization.rs new file mode 100755 index 00000000000..ac510ec4cb4 --- /dev/null +++ b/test/specialization.rs @@ -0,0 +1,19 @@ +#![feature(custom_attribute, specialization)] +#![allow(dead_code, unused_attributes)] + +trait IsUnit { + fn is_unit() -> bool; +} + +impl 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()) +}