diff options
Diffstat (limited to 'tests/ui/feature-gates/feature-gate-impl_trait_in_assoc_type.rs')
-rw-r--r-- | tests/ui/feature-gates/feature-gate-impl_trait_in_assoc_type.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/feature-gates/feature-gate-impl_trait_in_assoc_type.rs b/tests/ui/feature-gates/feature-gate-impl_trait_in_assoc_type.rs new file mode 100644 index 000000000..de0487cdb --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-impl_trait_in_assoc_type.rs @@ -0,0 +1,18 @@ +trait Foo { + type Bar; +} + +impl Foo for () { + type Bar = impl std::fmt::Debug; + //~^ ERROR: `impl Trait` in associated types is unstable +} + +struct Mop; + +impl Mop { + type Bop = impl std::fmt::Debug; + //~^ ERROR: `impl Trait` in associated types is unstable + //~| ERROR: inherent associated types are unstable +} + +fn main() {} |