]> git.proxmox.com Git - rustc.git/blob - src/test/ui/traits/wf-object/maybe-bound.rs
New upstream version 1.52.0~beta.3+dfsg1
[rustc.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() {}