]> git.proxmox.com Git - rustc.git/blob - src/test/ui/unsized3.stderr
New upstream version 1.52.1+dfsg1
[rustc.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 `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: consider relaxing the implicit `Sized` restriction
13 |
14 LL | fn f2<X: ?Sized>(x: &X) {
15 | ^^^^^^^^
16
17 error[E0277]: the size for values of type `X` cannot be known at compilation time
18 --> $DIR/unsized3.rs:18:13
19 |
20 LL | fn f3<X: ?Sized + T>(x: &X) {
21 | - this type parameter needs to be `Sized`
22 LL | f4::<X>(x);
23 | ^ doesn't have a size known at compile-time
24 ...
25 LL | fn f4<X: T>(x: &X) {
26 | - required by this bound in `f4`
27 |
28 help: consider relaxing the implicit `Sized` restriction
29 |
30 LL | fn f4<X: T + ?Sized>(x: &X) {
31 | ^^^^^^^^
32
33 error[E0277]: the size for values of type `X` cannot be known at compilation time
34 --> $DIR/unsized3.rs:33:8
35 |
36 LL | fn f5<Y>(x: &Y) {}
37 | - required by this bound in `f5`
38 ...
39 LL | fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
40 | - this type parameter needs to be `Sized`
41 LL | f5(x1);
42 | ^^ doesn't have a size known at compile-time
43 |
44 = note: required because it appears within the type `S<X>`
45 help: consider relaxing the implicit `Sized` restriction
46 |
47 LL | fn f5<Y: ?Sized>(x: &Y) {}
48 | ^^^^^^^^
49
50 error[E0277]: the size for values of type `X` cannot be known at compilation time
51 --> $DIR/unsized3.rs:40:8
52 |
53 LL | fn f9<X: ?Sized>(x1: Box<S<X>>) {
54 | - this type parameter needs to be `Sized`
55 LL | f5(&(*x1, 34));
56 | ^^^^^^^^^^ doesn't have a size known at compile-time
57 |
58 = note: required because it appears within the type `S<X>`
59 = note: only the last element of a tuple may have a dynamically sized type
60
61 error[E0277]: the size for values of type `X` cannot be known at compilation time
62 --> $DIR/unsized3.rs:45:9
63 |
64 LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
65 | - this type parameter needs to be `Sized`
66 LL | f5(&(32, *x1));
67 | ^^^^^^^^^ doesn't have a size known at compile-time
68 |
69 = note: required because it appears within the type `S<X>`
70 = note: required because it appears within the type `({integer}, S<X>)`
71 = note: tuples must have a statically known size to be initialized
72
73 error[E0277]: the size for values of type `X` cannot be known at compilation time
74 --> $DIR/unsized3.rs:45:8
75 |
76 LL | fn f5<Y>(x: &Y) {}
77 | - required by this bound in `f5`
78 ...
79 LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
80 | - this type parameter needs to be `Sized`
81 LL | f5(&(32, *x1));
82 | ^^^^^^^^^^ doesn't have a size known at compile-time
83 |
84 = note: required because it appears within the type `S<X>`
85 = note: required because it appears within the type `({integer}, S<X>)`
86 help: consider relaxing the implicit `Sized` restriction
87 |
88 LL | fn f5<Y: ?Sized>(x: &Y) {}
89 | ^^^^^^^^
90
91 error: aborting due to 6 previous errors
92
93 For more information about this error, try `rustc --explain E0277`.