2014-09-12 10:45:39 -04:00
|
|
|
// Check that when you implement a trait that has a sized type
|
|
|
|
// parameter, the corresponding value must be sized. Also that the
|
|
|
|
// self type must be sized if appropriate.
|
|
|
|
|
2014-12-19 06:54:09 -05:00
|
|
|
trait Foo<T> : Sized { fn take(self, x: &T) { } } // Note: T is sized
|
2014-09-12 10:45:39 -04:00
|
|
|
|
2015-01-06 15:34:10 -08:00
|
|
|
impl Foo<[isize]> for usize { }
|
2018-07-10 23:10:13 +02:00
|
|
|
//~^ ERROR the size for values of type
|
2014-09-12 10:45:39 -04:00
|
|
|
|
2014-12-05 18:12:25 -08:00
|
|
|
impl Foo<isize> for [usize] { }
|
2018-07-10 23:10:13 +02:00
|
|
|
//~^ ERROR the size for values of type
|
2014-09-12 10:45:39 -04:00
|
|
|
|
|
|
|
pub fn main() { }
|