2019-01-06 09:33:05 -06:00
|
|
|
trait Trait<'a> {}
|
2017-04-04 17:12:53 -05:00
|
|
|
|
2020-03-07 05:54:31 -06:00
|
|
|
trait Obj {}
|
|
|
|
|
2017-04-04 17:12:53 -05:00
|
|
|
fn f<T: (Copy) + (?Sized) + (for<'a> Trait<'a>)>() {}
|
|
|
|
|
|
|
|
fn main() {
|
2020-03-07 05:54:31 -06:00
|
|
|
let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>;
|
|
|
|
//~^ ERROR `?Trait` is not permitted in trait object types
|
|
|
|
//~| ERROR only auto traits can be used as additional traits
|
|
|
|
//~| WARN trait objects without an explicit `dyn` are deprecated
|
2021-04-16 04:06:51 -05:00
|
|
|
//~| WARN this was previously accepted by the compiler
|
|
|
|
let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>;
|
2019-05-19 16:26:42 -05:00
|
|
|
//~^ ERROR `?Trait` is not permitted in trait object types
|
2020-03-07 05:54:31 -06:00
|
|
|
//~| ERROR only auto traits can be used as additional traits
|
2019-05-28 13:45:27 -05:00
|
|
|
//~| WARN trait objects without an explicit `dyn` are deprecated
|
2021-04-16 04:06:51 -05:00
|
|
|
//~| WARN this was previously accepted by the compiler
|
|
|
|
let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>;
|
2020-03-07 05:54:31 -06:00
|
|
|
//~^ ERROR `?Trait` is not permitted in trait object types
|
|
|
|
//~| ERROR only auto traits can be used as additional traits
|
2019-05-28 13:45:27 -05:00
|
|
|
//~| WARN trait objects without an explicit `dyn` are deprecated
|
2021-04-16 04:06:51 -05:00
|
|
|
//~| WARN this was previously accepted by the compiler
|
2017-04-04 17:12:53 -05:00
|
|
|
}
|