//@ check-fail #![feature(sized_hierarchy)] use std::marker::{MetaSized, PointeeSized}; trait Sized_: Sized { } trait NegSized: ?Sized { } //~^ ERROR relaxed bounds are not permitted in supertrait bounds trait MetaSized_: MetaSized { } trait NegMetaSized: ?MetaSized { } //~^ ERROR relaxed bounds are not permitted in supertrait bounds //~| ERROR bound modifier `?` can only be applied to `Sized` //~| ERROR bound modifier `?` can only be applied to `Sized` //~| ERROR bound modifier `?` can only be applied to `Sized` trait PointeeSized_: PointeeSized { } trait NegPointeeSized: ?PointeeSized { } //~^ ERROR relaxed bounds are not permitted in supertrait bounds //~| ERROR bound modifier `?` can only be applied to `Sized` //~| ERROR bound modifier `?` can only be applied to `Sized` //~| ERROR bound modifier `?` can only be applied to `Sized` trait Bare {} fn requires_sized() {} fn requires_metasized() {} fn requires_pointeesized() {} fn with_sized_supertrait() { requires_sized::(); requires_metasized::(); requires_pointeesized::(); } fn with_metasized_supertrait() { requires_sized::(); //~^ ERROR the size for values of type `T` cannot be known at compilation time requires_metasized::(); requires_pointeesized::(); } // It isn't really possible to write this one.. fn with_pointeesized_supertrait() { requires_sized::(); //~^ ERROR the size for values of type `T` cannot be known requires_metasized::(); //~^ ERROR the size for values of type `T` cannot be known requires_pointeesized::(); } // `T` inherits the `const MetaSized` implicit supertrait of `Bare`. fn with_bare_trait() { requires_sized::(); //~^ ERROR the size for values of type `T` cannot be known requires_metasized::(); requires_pointeesized::(); } fn main() { }