]> git.proxmox.com Git - rustc.git/blame - src/test/ui/specialization/defaultimpl/overlap-projection.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / specialization / defaultimpl / overlap-projection.rs
CommitLineData
b7449926
XL
1// run-pass
2
7cac9316
XL
3// Test that impls on projected self types can resolve overlap, even when the
4// projections involve specialization, so long as the associated type is
5// provided by the most specialized impl.
6
f035d41b 7#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
7cac9316
XL
8
9trait Assoc {
10 type Output;
11}
12
13default impl<T> Assoc for T {
14 type Output = bool;
15}
16
17impl Assoc for u8 { type Output = u8; }
18impl Assoc for u16 { type Output = u16; }
19
20trait Foo {}
21impl Foo for u32 {}
22impl Foo for <u8 as Assoc>::Output {}
23impl Foo for <u16 as Assoc>::Output {}
24
25fn main() {}