]> git.proxmox.com Git - rustc.git/blob - src/test/ui/impl-trait/associated-impl-trait-type-generic-trait.rs
New upstream version 1.52.0~beta.3+dfsg1
[rustc.git] / src / test / ui / impl-trait / associated-impl-trait-type-generic-trait.rs
1 // revisions: min_tait full_tait
2 #![feature(min_type_alias_impl_trait)]
3 #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
4 //[full_tait]~^ WARN incomplete
5 // build-pass (FIXME(62277): could be check-pass?)
6
7 trait Bar {}
8 struct Dummy<U>(U);
9 impl<V> Bar for Dummy<V> {}
10
11 trait Foo<T> {
12 type Assoc: Bar;
13 fn foo(t: T) -> Self::Assoc;
14 }
15
16 impl<W> Foo<W> for i32 {
17 type Assoc = impl Bar;
18 fn foo(w: W) -> Self::Assoc {
19 Dummy(w)
20 }
21 }
22
23 struct NonGeneric;
24 impl Bar for NonGeneric {}
25
26 impl<W> Foo<W> for u32 {
27 type Assoc = impl Bar;
28 fn foo(_: W) -> Self::Assoc {
29 NonGeneric
30 }
31 }
32
33 fn main() {}