2019-05-01 20:21:20 -05:00
|
|
|
// Test that `dyn ... + ?Sized + ...` is okay (though `?Sized` has no effect in trait objects).
|
2019-03-30 17:06:09 -05:00
|
|
|
|
2019-05-01 20:21:20 -05:00
|
|
|
trait Foo {}
|
2019-03-30 17:06:09 -05:00
|
|
|
|
2019-05-01 20:21:20 -05:00
|
|
|
type _0 = dyn ?Sized + Foo;
|
2019-05-19 16:26:42 -05:00
|
|
|
//~^ ERROR `?Trait` is not permitted in trait object types
|
2019-03-30 17:06:09 -05:00
|
|
|
|
2019-05-01 20:21:20 -05:00
|
|
|
type _1 = dyn Foo + ?Sized;
|
2019-05-19 16:26:42 -05:00
|
|
|
//~^ ERROR `?Trait` is not permitted in trait object types
|
2019-05-01 20:21:20 -05:00
|
|
|
|
|
|
|
type _2 = dyn Foo + ?Sized + ?Sized;
|
2019-05-19 16:26:42 -05:00
|
|
|
//~^ ERROR `?Trait` is not permitted in trait object types
|
|
|
|
//~| ERROR `?Trait` is not permitted in trait object types
|
2019-05-01 20:21:20 -05:00
|
|
|
|
|
|
|
type _3 = dyn ?Sized + Foo;
|
2019-05-19 16:26:42 -05:00
|
|
|
//~^ ERROR `?Trait` is not permitted in trait object types
|
2019-03-30 17:06:09 -05:00
|
|
|
|
|
|
|
fn main() {}
|