diff options
Diffstat (limited to 'tests/ui/impl-trait/in-trait/rpitit-duplicate-associated-fn-with-nested.rs')
| -rw-r--r-- | tests/ui/impl-trait/in-trait/rpitit-duplicate-associated-fn-with-nested.rs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/in-trait/rpitit-duplicate-associated-fn-with-nested.rs b/tests/ui/impl-trait/in-trait/rpitit-duplicate-associated-fn-with-nested.rs new file mode 100644 index 00000000000..e3dc22c1992 --- /dev/null +++ b/tests/ui/impl-trait/in-trait/rpitit-duplicate-associated-fn-with-nested.rs @@ -0,0 +1,46 @@ +// issue#143560 + +trait T { + type Target; +} + +trait Foo { + fn foo() -> impl T<Target = impl T<Target = impl Sized>>; + fn foo() -> impl Sized; + //~^ ERROR: the name `foo` is defined multiple times +} + +trait Bar { + fn foo() -> impl T<Target = impl T<Target = impl Sized>>; + fn foo() -> impl T<Target = impl T<Target = impl Sized>>; + //~^ ERROR: the name `foo` is defined multiple times +} + +struct S<T> { + a: T +} + +trait Baz { + fn foo() -> S<impl T<Target = S<S<impl Sized>>>>; + fn foo() -> S<impl T<Target = S<S<impl Sized>>>>; + //~^ ERROR: the name `foo` is defined multiple times +} + +struct S1<T1, T2> { + a: T1, + b: T2 +} + +trait Qux { + fn foo() -> S1< + impl T<Target = impl T<Target = impl Sized>>, + impl T<Target = impl T<Target = S<impl Sized>>> + >; + fn foo() -> S1< + impl T<Target = impl T<Target = impl Sized>>, + impl T<Target = impl T<Target = S<impl Sized>>> + >; + //~^^^^ ERROR: the name `foo` is defined multiple times +} + +fn main() {} |
