diff options
Diffstat (limited to 'src/test/ui/specialization/specialization-on-projection.rs')
-rw-r--r-- | src/test/ui/specialization/specialization-on-projection.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/ui/specialization/specialization-on-projection.rs b/src/test/ui/specialization/specialization-on-projection.rs new file mode 100644 index 000000000..be8dcc423 --- /dev/null +++ b/src/test/ui/specialization/specialization-on-projection.rs @@ -0,0 +1,24 @@ +// run-pass +#![allow(dead_code)] + +#![feature(specialization)] //~ WARN the feature `specialization` is incomplete + +// Ensure that specialization works for impls defined directly on a projection + +trait Foo<T> {} + +trait Assoc { + type Item; +} + +impl<T: Assoc> Foo<T::Item> for T {} + +struct Struct; + +impl Assoc for Struct { + type Item = u8; +} + +impl Foo<u8> for Struct {} + +fn main() {} |