]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized3.stderr
Merge commit '2ca58e7dda4a9eb142599638c59dc04d15961175' into clippyup
[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 help: consider relaxing the implicit `Sized` restriction
52    |
53 LL | fn f5<Y: ?Sized>(x: &Y) {}
54    |        ^^^^^^^^
55
56 error[E0277]: the size for values of type `X` cannot be known at compilation time
57   --> $DIR/unsized3.rs:40:8
58    |
59 LL | fn f9<X: ?Sized>(x1: Box<S<X>>) {
60    |       - this type parameter needs to be `std::marker::Sized`
61 LL |     f5(&(*x1, 34));
62    |        ^^^^^^^^^^ doesn't have a size known at compile-time
63    |
64    = help: within `S<X>`, the trait `std::marker::Sized` is not implemented for `X`
65    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
66    = note: required because it appears within the type `S<X>`
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    = help: within `({integer}, S<X>)`, the trait `std::marker::Sized` is not implemented for `X`
78    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
79    = note: required because it appears within the type `S<X>`
80    = note: required because it appears within the type `({integer}, S<X>)`
81    = note: tuples must have a statically known size to be initialized
82
83 error[E0277]: the size for values of type `X` cannot be known at compilation time
84   --> $DIR/unsized3.rs:45:8
85    |
86 LL | fn f5<Y>(x: &Y) {}
87    |       - required by this bound in `f5`
88 ...
89 LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
90    |        - this type parameter needs to be `std::marker::Sized`
91 LL |     f5(&(32, *x1));
92    |        ^^^^^^^^^^ doesn't have a size known at compile-time
93    |
94    = help: within `({integer}, S<X>)`, the trait `std::marker::Sized` is not implemented for `X`
95    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
96    = note: required because it appears within the type `S<X>`
97    = note: required because it appears within the type `({integer}, S<X>)`
98 help: consider relaxing the implicit `Sized` restriction
99    |
100 LL | fn f5<Y: ?Sized>(x: &Y) {}
101    |        ^^^^^^^^
102
103 error: aborting due to 6 previous errors
104
105 For more information about this error, try `rustc --explain E0277`.