diff options
Diffstat (limited to 'tests/ui/specialization/defaultimpl/out-of-order.rs')
-rw-r--r-- | tests/ui/specialization/defaultimpl/out-of-order.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/specialization/defaultimpl/out-of-order.rs b/tests/ui/specialization/defaultimpl/out-of-order.rs new file mode 100644 index 000000000..13258ac8c --- /dev/null +++ b/tests/ui/specialization/defaultimpl/out-of-order.rs @@ -0,0 +1,19 @@ +// run-pass + +// Test that you can list the more specific impl before the more general one. + +#![feature(specialization)] //~ WARN the feature `specialization` is incomplete + +trait Foo { + type Out; +} + +impl Foo for bool { + type Out = (); +} + +default impl<T> Foo for T { + type Out = bool; +} + +fn main() {} |