]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized/unsized3.stderr
Auto merge of #97657 - Urgau:check-cfg-many-mut, r=oli-obk
[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    |     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:8
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    |     required by a bound introduced by this call
90    |
91 note: required because it appears within the type `S<X>`
92   --> $DIR/unsized3.rs:28:8
93    |
94 LL | struct S<X: ?Sized> {
95    |        ^
96    = note: only the last element of a tuple may have a dynamically sized type
97 help: consider removing the `?Sized` bound to make the type parameter `Sized`
98    |
99 LL - fn f9<X: ?Sized>(x1: Box<S<X>>) {
100 LL + fn f9<X>(x1: Box<S<X>>) {
101    |
102
103 error[E0277]: the size for values of type `X` cannot be known at compilation time
104   --> $DIR/unsized3.rs:45:8
105    |
106 LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
107    |        - this type parameter needs to be `std::marker::Sized`
108 LL |     f5(&(32, *x1));
109    |     -- ^^^^^^^^^^ doesn't have a size known at compile-time
110    |     |
111    |     required by a bound introduced by this call
112    |
113 note: required because it appears within the type `S<X>`
114   --> $DIR/unsized3.rs:28:8
115    |
116 LL | struct S<X: ?Sized> {
117    |        ^
118    = note: required because it appears within the type `({integer}, S<X>)`
119    = note: tuples must have a statically known size to be initialized
120 help: consider removing the `?Sized` bound to make the type parameter `Sized`
121    |
122 LL - fn f10<X: ?Sized>(x1: Box<S<X>>) {
123 LL + fn f10<X>(x1: Box<S<X>>) {
124    |
125
126 error: aborting due to 5 previous errors
127
128 For more information about this error, try `rustc --explain E0277`.