]> git.lizzy.rs Git - rust.git/blob - tests/ui/unsized/unsized3.stderr
Auto merge of #107618 - chriswailes:linker-arg, r=albertlarsan68
[rust.git] / tests / 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    |     required by a bound introduced by this call
10    |
11 note: required by a bound in `f2`
12   --> $DIR/unsized3.rs:10:7
13    |
14 LL | fn f2<X>(x: &X) {
15    |       ^ required by this bound in `f2`
16 help: consider removing the `?Sized` bound to make the type parameter `Sized`
17    |
18 LL - fn f1<X: ?Sized>(x: &X) {
19 LL + fn f1<X>(x: &X) {
20    |
21 help: consider relaxing the implicit `Sized` restriction
22    |
23 LL | fn f2<X: ?Sized>(x: &X) {
24    |        ++++++++
25
26 error[E0277]: the size for values of type `X` cannot be known at compilation time
27   --> $DIR/unsized3.rs:18:13
28    |
29 LL | fn f3<X: ?Sized + T>(x: &X) {
30    |       - this type parameter needs to be `std::marker::Sized`
31 LL |     f4::<X>(x);
32    |     ------- ^ doesn't have a size known at compile-time
33    |     |
34    |     required by a bound introduced by this call
35    |
36 note: required by a bound in `f4`
37   --> $DIR/unsized3.rs:21:7
38    |
39 LL | fn f4<X: T>(x: &X) {
40    |       ^ required by this bound in `f4`
41 help: consider removing the `?Sized` bound to make the type parameter `Sized`
42    |
43 LL - fn f3<X: ?Sized + T>(x: &X) {
44 LL + fn f3<X: T>(x: &X) {
45    |
46 help: consider relaxing the implicit `Sized` restriction
47    |
48 LL | fn f4<X: T + ?Sized>(x: &X) {
49    |            ++++++++
50
51 error[E0277]: the size for values of type `X` cannot be known at compilation time
52   --> $DIR/unsized3.rs:33:8
53    |
54 LL | fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
55    |       - this type parameter needs to be `std::marker::Sized`
56 LL |     f5(x1);
57    |     -- ^^ doesn't have a size known at compile-time
58    |     |
59    |     required by a bound introduced by this call
60    |
61 note: required because it appears within the type `S<X>`
62   --> $DIR/unsized3.rs:28:8
63    |
64 LL | struct S<X: ?Sized> {
65    |        ^
66 note: required by a bound in `f5`
67   --> $DIR/unsized3.rs:24:7
68    |
69 LL | fn f5<Y>(x: &Y) {}
70    |       ^ required by this bound in `f5`
71 help: consider removing the `?Sized` bound to make the type parameter `Sized`
72    |
73 LL - fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
74 LL + fn f8<X>(x1: &S<X>, x2: &S<X>) {
75    |
76 help: consider relaxing the implicit `Sized` restriction
77    |
78 LL | fn f5<Y: ?Sized>(x: &Y) {}
79    |        ++++++++
80
81 error[E0277]: the size for values of type `X` cannot be known at compilation time
82   --> $DIR/unsized3.rs:40:5
83    |
84 LL | fn f9<X: ?Sized>(x1: Box<S<X>>) {
85    |       - this type parameter needs to be `std::marker::Sized`
86 LL |     f5(&(*x1, 34));
87    |     ^^ doesn't have a size known at compile-time
88    |
89 note: required because it appears within the type `S<X>`
90   --> $DIR/unsized3.rs:28:8
91    |
92 LL | struct S<X: ?Sized> {
93    |        ^
94    = note: only the last element of a tuple may have a dynamically sized type
95 help: consider removing the `?Sized` bound to make the type parameter `Sized`
96    |
97 LL - fn f9<X: ?Sized>(x1: Box<S<X>>) {
98 LL + fn f9<X>(x1: Box<S<X>>) {
99    |
100
101 error[E0277]: the size for values of type `X` cannot be known at compilation time
102   --> $DIR/unsized3.rs:45:9
103    |
104 LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
105    |        - this type parameter needs to be `std::marker::Sized`
106 LL |     f5(&(32, *x1));
107    |         ^^^^^^^^^ doesn't have a size known at compile-time
108    |
109 note: required because it appears within the type `S<X>`
110   --> $DIR/unsized3.rs:28:8
111    |
112 LL | struct S<X: ?Sized> {
113    |        ^
114    = note: required because it appears within the type `({integer}, S<X>)`
115    = note: tuples must have a statically known size to be initialized
116 help: consider removing the `?Sized` bound to make the type parameter `Sized`
117    |
118 LL - fn f10<X: ?Sized>(x1: Box<S<X>>) {
119 LL + fn f10<X>(x1: Box<S<X>>) {
120    |
121
122 error[E0277]: the size for values of type `X` cannot be known at compilation time
123   --> $DIR/unsized3.rs:45:8
124    |
125 LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
126    |        - this type parameter needs to be `std::marker::Sized`
127 LL |     f5(&(32, *x1));
128    |     -- ^^^^^^^^^^ doesn't have a size known at compile-time
129    |     |
130    |     required by a bound introduced by this call
131    |
132 note: required because it appears within the type `S<X>`
133   --> $DIR/unsized3.rs:28:8
134    |
135 LL | struct S<X: ?Sized> {
136    |        ^
137    = note: required because it appears within the type `({integer}, S<X>)`
138 note: required by a bound in `f5`
139   --> $DIR/unsized3.rs:24:7
140    |
141 LL | fn f5<Y>(x: &Y) {}
142    |       ^ required by this bound in `f5`
143 help: consider removing the `?Sized` bound to make the type parameter `Sized`
144    |
145 LL - fn f10<X: ?Sized>(x1: Box<S<X>>) {
146 LL + fn f10<X>(x1: Box<S<X>>) {
147    |
148 help: consider relaxing the implicit `Sized` restriction
149    |
150 LL | fn f5<Y: ?Sized>(x: &Y) {}
151    |        ++++++++
152
153 error: aborting due to 6 previous errors
154
155 For more information about this error, try `rustc --explain E0277`.