2014-09-12 14:45:39 +00: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 11:54:09 +00:00
|
|
|
trait Foo<T> : Sized { fn take(self, x: &T) { } } // Note: T is sized
|
2014-09-12 14:45:39 +00:00
|
|
|
|
2015-01-06 23:34:10 +00:00
|
|
|
impl Foo<[isize]> for usize { }
|
2018-07-10 21:10:13 +00:00
|
|
|
//~^ ERROR the size for values of type
|
2014-09-12 14:45:39 +00:00
|
|
|
|
2014-12-06 02:12:25 +00:00
|
|
|
impl Foo<isize> for [usize] { }
|
2018-07-10 21:10:13 +00:00
|
|
|
//~^ ERROR the size for values of type
|
2014-09-12 14:45:39 +00:00
|
|
|
|
|
|
|
pub fn main() { }
|