]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/wf-object/maybe-bound.rs
Rollup merge of #82179 - mbartlett21:patch-5, r=joshtriplett
[rust.git] / src / test / ui / traits / wf-object / maybe-bound.rs
1 // Test that `dyn ... + ?Sized + ...` is okay (though `?Sized` has no effect in trait objects).
2
3 trait Foo {}
4
5 type _0 = dyn ?Sized + Foo;
6 //~^ ERROR `?Trait` is not permitted in trait object types
7
8 type _1 = dyn Foo + ?Sized;
9 //~^ ERROR `?Trait` is not permitted in trait object types
10
11 type _2 = dyn Foo + ?Sized + ?Sized;
12 //~^ ERROR `?Trait` is not permitted in trait object types
13 //~| ERROR `?Trait` is not permitted in trait object types
14
15 type _3 = dyn ?Sized + Foo;
16 //~^ ERROR `?Trait` is not permitted in trait object types
17
18 fn main() {}