]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/alias/only-maybe-bound.rs
Rollup merge of #100953 - joshtriplett:write-docs, r=Mark-Simulacrum
[rust.git] / src / test / ui / traits / alias / only-maybe-bound.rs
1 // Test that `dyn ?Sized` (i.e., a trait object with only a maybe buond) is not allowed, when just
2 // `?Sized` results from trait alias expansion.
3
4 #![feature(trait_alias)]
5
6 trait S = ?Sized;
7
8 // Nest a couple of levels deep:
9 trait _0 = S;
10 trait _1 = _0;
11
12 // Straight list expansion:
13 type _T0 = dyn _1;
14 //~^ ERROR at least one trait is required for an object type [E0224]
15
16 // Twice:
17 trait _2 = _1 + _1;
18
19 type _T1 = dyn _2;
20 //~^ ERROR at least one trait is required for an object type [E0224]
21
22 fn main() {}