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