]> git.proxmox.com Git - rustc.git/blob - src/test/ui/traits/trait-alias/trait-alias-maybe-bound.rs
New upstream version 1.51.0+dfsg1
[rustc.git] / src / test / ui / traits / trait-alias / trait-alias-maybe-bound.rs
1 // build-pass (FIXME(62277): could be check-pass?)
2
3 // Test that `dyn ... + ?Sized + ...` resulting from the expansion of trait aliases is okay.
4
5 #![feature(trait_alias)]
6
7 trait Foo {}
8
9 trait S = ?Sized;
10
11 // Nest a couple of levels deep:
12 trait _0 = S;
13 trait _1 = _0;
14
15 // Straight list expansion:
16 type _T0 = dyn _1 + Foo;
17
18 // In second position:
19 type _T1 = dyn Foo + _1;
20
21 // ... and with an auto trait:
22 type _T2 = dyn Foo + Send + _1;
23
24 // Twice:
25 trait _2 = _1 + _1;
26
27 type _T3 = dyn _2 + Foo;
28
29 fn main() {}