blob: f24c1301c53abe6a5ca388b19d14104d5c9c5c5d [file] [log] [blame]
// compile-fail
// 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() {}