]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized3.stderr
Rollup merge of #72279 - RalfJung:raw-ref-macros, r=nikomatsakis
[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    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
14 help: consider relaxing the implicit `Sized` restriction
15    |
16 LL | fn f2<X: ?Sized>(x: &X) {
17    |        ^^^^^^^^
18
19 error[E0277]: the size for values of type `X` cannot be known at compilation time
20   --> $DIR/unsized3.rs:18:13
21    |
22 LL | fn f3<X: ?Sized + T>(x: &X) {
23    |       - this type parameter needs to be `std::marker::Sized`
24 LL |     f4::<X>(x);
25    |             ^ doesn't have a size known at compile-time
26 ...
27 LL | 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>
32 help: consider relaxing the implicit `Sized` restriction
33    |
34 LL | fn f4<X: T + ?Sized>(x: &X) {
35    |            ^^^^^^^^
36
37 error[E0277]: the size for values of type `X` cannot be known at compilation time
38   --> $DIR/unsized3.rs:33:8
39    |
40 LL | fn f5<Y>(x: &Y) {}
41    |       - required by this bound in `f5`
42 ...
43 LL | fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
44    |       - this type parameter needs to be `std::marker::Sized`
45 LL |     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
52 error[E0277]: the size for values of type `X` cannot be known at compilation time
53   --> $DIR/unsized3.rs:40:8
54    |
55 LL | fn f9<X: ?Sized>(x1: Box<S<X>>) {
56    |       - this type parameter needs to be `std::marker::Sized`
57 LL |     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
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: 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
79 error[E0277]: the size for values of type `X` cannot be known at compilation time
80   --> $DIR/unsized3.rs:45:8
81    |
82 LL | fn f5<Y>(x: &Y) {}
83    |       - required by this bound in `f5`
84 ...
85 LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
86    |        - this type parameter needs to be `std::marker::Sized`
87 LL |     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
95 error: aborting due to 6 previous errors
96
97 For more information about this error, try `rustc --explain E0277`.