]> git.proxmox.com Git - rustc.git/blame - src/test/ui/type-alias-impl-trait/issue-63677-type-alias-coherence.rs
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / type-alias-impl-trait / issue-63677-type-alias-coherence.rs
CommitLineData
e74abb32
XL
1// check-pass
2// Regression test for issue #63677 - ensure that
3// coherence checking can properly handle 'impl trait'
4// in type aliases
94222f64 5#![feature(type_alias_impl_trait)]
e74abb32
XL
6
7pub trait Trait {}
8pub struct S1<T>(T);
9pub struct S2<T>(T);
10
11pub type T1 = impl Trait;
12pub type T2 = S1<T1>;
13pub type T3 = S2<T2>;
14
15impl<T> Trait for S1<T> {}
16impl<T: Trait> S2<T> {}
17impl T3 {}
18
19pub fn use_t1() -> T1 { S1(()) }
20
21fn main() {}