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