]> git.lizzy.rs Git - rust.git/blob - src/test/ui/dst/dst-sized-trait-param.rs
Rollup merge of #100479 - compiler-errors:argument-type-error-improvements, r=lcnr
[rust.git] / src / test / ui / dst / dst-sized-trait-param.rs
1 // Check that when you implement a trait that has a sized type
2 // parameter, the corresponding value must be sized. Also that the
3 // self type must be sized if appropriate.
4
5 trait Foo<T> : Sized { fn take(self, x: &T) { } } // Note: T is sized
6
7 impl Foo<[isize]> for usize { }
8 //~^ ERROR the size for values of type
9
10 impl Foo<isize> for [usize] { }
11 //~^ ERROR the size for values of type
12
13 pub fn main() { }