]> git.lizzy.rs Git - rust.git/blob - tests/ui/unsized/unsized-inherent-impl-self-type.stderr
Rollup merge of #106321 - compiler-errors:delayed-bug-backtrace, r=Nilstrieb
[rust.git] / tests / ui / unsized / unsized-inherent-impl-self-type.stderr
1 error[E0277]: the size for values of type `X` cannot be known at compilation time
2   --> $DIR/unsized-inherent-impl-self-type.rs:7:17
3    |
4 LL | impl<X: ?Sized> S5<X> {
5    |      -          ^^^^^ doesn't have a size known at compile-time
6    |      |
7    |      this type parameter needs to be `std::marker::Sized`
8    |
9 note: required by a bound in `S5`
10   --> $DIR/unsized-inherent-impl-self-type.rs:5:11
11    |
12 LL | struct S5<Y>(Y);
13    |           ^ required by this bound in `S5`
14 help: you could relax the implicit `Sized` bound on `Y` if it were used through indirection like `&Y` or `Box<Y>`
15   --> $DIR/unsized-inherent-impl-self-type.rs:5:11
16    |
17 LL | struct S5<Y>(Y);
18    |           ^  - ...if indirection were used here: `Box<Y>`
19    |           |
20    |           this could be changed to `Y: ?Sized`...
21 help: consider removing the `?Sized` bound to make the type parameter `Sized`
22    |
23 LL - impl<X: ?Sized> S5<X> {
24 LL + impl<X> S5<X> {
25    |
26
27 error: aborting due to previous error
28
29 For more information about this error, try `rustc --explain E0277`.