summaryrefslogtreecommitdiffstats
path: root/src/test/ui/traits/wf-object/maybe-bound.rs
blob: 17771e976ef3b3d6ce36faf8c804966334324831 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Test that `dyn ... + ?Sized + ...` is okay (though `?Sized` has no effect in trait objects).

trait Foo {}

type _0 = dyn ?Sized + Foo;
//~^ ERROR `?Trait` is not permitted in trait object types

type _1 = dyn Foo + ?Sized;
//~^ ERROR `?Trait` is not permitted in trait object types

type _2 = dyn Foo + ?Sized + ?Sized;
//~^ ERROR `?Trait` is not permitted in trait object types
//~| ERROR `?Trait` is not permitted in trait object types

type _3 = dyn ?Sized + Foo;
//~^ ERROR `?Trait` is not permitted in trait object types

fn main() {}