fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

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