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