summaryrefslogtreecommitdiffstats
path: root/tests/ui/dst/dst-sized-trait-param.rs
blob: cfd59197becf02b8c9e5eddc5898f6c05312e8dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// 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.

trait Foo<T> : Sized { fn take(self, x: &T) { } } // Note: T is sized

impl Foo<[isize]> for usize { }
//~^ ERROR the size for values of type

impl Foo<isize> for [usize] { }
//~^ ERROR the size for values of type

pub fn main() { }