//@ check-fail #![feature(extern_types, sized_hierarchy)] use std::marker::{MetaSized, PointeeSized}; fn bare() {} fn sized() {} fn neg_sized() {} fn metasized() {} fn neg_metasized() {} //~^ ERROR bound modifier `?` can only be applied to `Sized` fn pointeesized() { } fn neg_pointeesized() { } //~^ ERROR bound modifier `?` can only be applied to `Sized` fn main() { // Functions which should have a `T: Sized` bound - check for an error given a non-Sized type: bare::<[u8]>(); //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time sized::<[u8]>(); //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time metasized::<[u8]>(); pointeesized::<[u8]>(); // Functions which should have a `T: MetaSized` bound - check for an error given a // non-MetaSized type: unsafe extern "C" { type Foo; } bare::(); //~^ ERROR the size for values of type `main::Foo` cannot be known sized::(); //~^ ERROR the size for values of type `main::Foo` cannot be known metasized::(); //~^ ERROR the size for values of type `main::Foo` cannot be known pointeesized::(); }