diff options
Diffstat (limited to 'src/test/ui/impl-trait/type-alias-generic-param.rs')
-rw-r--r-- | src/test/ui/impl-trait/type-alias-generic-param.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/ui/impl-trait/type-alias-generic-param.rs b/src/test/ui/impl-trait/type-alias-generic-param.rs new file mode 100644 index 000000000..3499b2859 --- /dev/null +++ b/src/test/ui/impl-trait/type-alias-generic-param.rs @@ -0,0 +1,23 @@ +// Regression test for issue #59342 +// Checks that we properly detect defining uses of opaque +// types in 'item' position when generic parameters are involved +// +// run-pass +#![feature(type_alias_impl_trait)] + +trait Meow { + type MeowType; + fn meow(self) -> Self::MeowType; +} + +impl<T, I> Meow for I +where + I: Iterator<Item = T>, +{ + type MeowType = impl Iterator<Item = T>; + fn meow(self) -> Self::MeowType { + self + } +} + +fn main() {} |