]> git.lizzy.rs Git - rust.git/blob - src/test/ui/dst/dst-sized-trait-param.stderr
Auto merge of #75936 - sdroege:chunks-exact-construction-bounds-check, r=nagisa
[rust.git] / src / test / ui / dst / dst-sized-trait-param.stderr
1 error[E0277]: the size for values of type `[isize]` cannot be known at compilation time
2   --> $DIR/dst-sized-trait-param.rs:7:6
3    |
4 LL | trait Foo<T> : Sized { fn take(self, x: &T) { } } // Note: T is sized
5    |           - required by this bound in `Foo`
6 LL | 
7 LL | impl Foo<[isize]> for usize { }
8    |      ^^^^^^^^^^^^ doesn't have a size known at compile-time
9    |
10    = help: the trait `std::marker::Sized` is not implemented for `[isize]`
11 help: consider relaxing the implicit `Sized` restriction
12    |
13 LL | trait Foo<T: ?Sized> : Sized { fn take(self, x: &T) { } } // Note: T is sized
14    |            ^^^^^^^^
15
16 error[E0277]: the size for values of type `[usize]` cannot be known at compilation time
17   --> $DIR/dst-sized-trait-param.rs:10:6
18    |
19 LL | trait Foo<T> : Sized { fn take(self, x: &T) { } } // Note: T is sized
20    |                ----- required by this bound in `Foo`
21 ...
22 LL | impl Foo<isize> for [usize] { }
23    |      ^^^^^^^^^^ doesn't have a size known at compile-time
24    |
25    = help: the trait `std::marker::Sized` is not implemented for `[usize]`
26
27 error: aborting due to 2 previous errors
28
29 For more information about this error, try `rustc --explain E0277`.