]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized3.stderr
Remove `Sized` `on_unimplemented` note
[rust.git] / src / test / ui / unsized3.stderr
1 error[E0277]: the size for values of type `X` cannot be known at compilation time
2   --> $DIR/unsized3.rs:7:13
3    |
4 LL | fn f1<X: ?Sized>(x: &X) {
5    |       - this type parameter needs to be `std::marker::Sized`
6 LL |     f2::<X>(x);
7    |             ^ doesn't have a size known at compile-time
8 ...
9 LL | fn f2<X>(x: &X) {
10    |       - required by this bound in `f2`
11    |
12    = help: the trait `std::marker::Sized` is not implemented for `X`
13 help: consider relaxing the implicit `Sized` restriction
14    |
15 LL | fn f2<X: ?Sized>(x: &X) {
16    |        ^^^^^^^^
17
18 error[E0277]: the size for values of type `X` cannot be known at compilation time
19   --> $DIR/unsized3.rs:18:13
20    |
21 LL | fn f3<X: ?Sized + T>(x: &X) {
22    |       - this type parameter needs to be `std::marker::Sized`
23 LL |     f4::<X>(x);
24    |             ^ doesn't have a size known at compile-time
25 ...
26 LL | fn f4<X: T>(x: &X) {
27    |       - required by this bound in `f4`
28    |
29    = help: the trait `std::marker::Sized` is not implemented for `X`
30 help: consider relaxing the implicit `Sized` restriction
31    |
32 LL | fn f4<X: T + ?Sized>(x: &X) {
33    |            ^^^^^^^^
34
35 error[E0277]: the size for values of type `X` cannot be known at compilation time
36   --> $DIR/unsized3.rs:33:8
37    |
38 LL | fn f5<Y>(x: &Y) {}
39    |       - required by this bound in `f5`
40 ...
41 LL | fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
42    |       - this type parameter needs to be `std::marker::Sized`
43 LL |     f5(x1);
44    |        ^^ doesn't have a size known at compile-time
45    |
46    = help: within `S<X>`, the trait `std::marker::Sized` is not implemented for `X`
47    = note: required because it appears within the type `S<X>`
48 help: consider relaxing the implicit `Sized` restriction
49    |
50 LL | fn f5<Y: ?Sized>(x: &Y) {}
51    |        ^^^^^^^^
52
53 error[E0277]: the size for values of type `X` cannot be known at compilation time
54   --> $DIR/unsized3.rs:40:8
55    |
56 LL | fn f9<X: ?Sized>(x1: Box<S<X>>) {
57    |       - this type parameter needs to be `std::marker::Sized`
58 LL |     f5(&(*x1, 34));
59    |        ^^^^^^^^^^ doesn't have a size known at compile-time
60    |
61    = help: within `S<X>`, the trait `std::marker::Sized` is not implemented for `X`
62    = note: required because it appears within the type `S<X>`
63    = note: only the last element of a tuple may have a dynamically sized type
64
65 error[E0277]: the size for values of type `X` cannot be known at compilation time
66   --> $DIR/unsized3.rs:45:9
67    |
68 LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
69    |        - this type parameter needs to be `std::marker::Sized`
70 LL |     f5(&(32, *x1));
71    |         ^^^^^^^^^ doesn't have a size known at compile-time
72    |
73    = help: within `({integer}, S<X>)`, the trait `std::marker::Sized` is not implemented for `X`
74    = note: required because it appears within the type `S<X>`
75    = note: required because it appears within the type `({integer}, S<X>)`
76    = note: tuples must have a statically known size to be initialized
77
78 error[E0277]: the size for values of type `X` cannot be known at compilation time
79   --> $DIR/unsized3.rs:45:8
80    |
81 LL | fn f5<Y>(x: &Y) {}
82    |       - required by this bound in `f5`
83 ...
84 LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
85    |        - this type parameter needs to be `std::marker::Sized`
86 LL |     f5(&(32, *x1));
87    |        ^^^^^^^^^^ doesn't have a size known at compile-time
88    |
89    = help: within `({integer}, S<X>)`, the trait `std::marker::Sized` is not implemented for `X`
90    = note: required because it appears within the type `S<X>`
91    = note: required because it appears within the type `({integer}, S<X>)`
92 help: consider relaxing the implicit `Sized` restriction
93    |
94 LL | fn f5<Y: ?Sized>(x: &Y) {}
95    |        ^^^^^^^^
96
97 error: aborting due to 6 previous errors
98
99 For more information about this error, try `rustc --explain E0277`.