fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
4.2 KiB112 linesraw
1error[E0277]: the size for values of type `T` cannot be known at compilation time
2  --> $DIR/adt-param-with-implicit-sized-bound.rs:25:9
3   |
4LL | struct Struct5<T: ?Sized>{
5   |                - this type parameter needs to be `Sized`
6LL |     _t: X<T>,
7   |         ^^^^ doesn't have a size known at compile-time
8   |
9note: required by a bound in `X`
10  --> $DIR/adt-param-with-implicit-sized-bound.rs:18:10
11   |
12LL | struct X<T>(T);
13   |          ^ required by this bound in `X`
14help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
15  --> $DIR/adt-param-with-implicit-sized-bound.rs:18:10
16   |
17LL | struct X<T>(T);
18   |          ^  - ...if indirection were used here: `Box<T>`
19   |          |
20   |          this could be changed to `T: ?Sized`...
21help: consider removing the `?Sized` bound to make the type parameter `Sized`
22   |
23LL - struct Struct5<T: ?Sized>{
24LL + struct Struct5<T>{
25   |
26
27error[E0277]: the size for values of type `Self` cannot be known at compilation time
28  --> $DIR/adt-param-with-implicit-sized-bound.rs:2:19
29   |
30LL |     fn func1() -> Struct1<Self>;
31   |                   ^^^^^^^^^^^^^ doesn't have a size known at compile-time
32   |
33note: required by a bound in `Struct1`
34  --> $DIR/adt-param-with-implicit-sized-bound.rs:8:16
35   |
36LL | struct Struct1<T>{
37   |                ^ required by this bound in `Struct1`
38help: consider further restricting `Self`
39   |
40LL |     fn func1() -> Struct1<Self> where Self: Sized;
41   |                                 +++++++++++++++++
42help: consider relaxing the implicit `Sized` restriction
43   |
44LL | struct Struct1<T: ?Sized>{
45   |                 ++++++++
46
47error[E0277]: the size for values of type `Self` cannot be known at compilation time
48  --> $DIR/adt-param-with-implicit-sized-bound.rs:3:23
49   |
50LL |     fn func2<'a>() -> Struct2<'a, Self>;
51   |                       ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
52   |
53note: required by a bound in `Struct2`
54  --> $DIR/adt-param-with-implicit-sized-bound.rs:11:20
55   |
56LL | struct Struct2<'a, T>{
57   |                    ^ required by this bound in `Struct2`
58help: consider further restricting `Self`
59   |
60LL |     fn func2<'a>() -> Struct2<'a, Self> where Self: Sized;
61   |                                         +++++++++++++++++
62help: consider relaxing the implicit `Sized` restriction
63   |
64LL | struct Struct2<'a, T: ?Sized>{
65   |                     ++++++++
66
67error[E0277]: the size for values of type `Self` cannot be known at compilation time
68  --> $DIR/adt-param-with-implicit-sized-bound.rs:4:19
69   |
70LL |     fn func3() -> Struct3<Self>;
71   |                   ^^^^^^^^^^^^^ doesn't have a size known at compile-time
72   |
73note: required by a bound in `Struct3`
74  --> $DIR/adt-param-with-implicit-sized-bound.rs:14:16
75   |
76LL | struct Struct3<T>{
77   |                ^ required by this bound in `Struct3`
78help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
79  --> $DIR/adt-param-with-implicit-sized-bound.rs:14:16
80   |
81LL | struct Struct3<T>{
82   |                ^ this could be changed to `T: ?Sized`...
83LL |     _t: T,
84   |         - ...if indirection were used here: `Box<T>`
85help: consider further restricting `Self`
86   |
87LL |     fn func3() -> Struct3<Self> where Self: Sized;
88   |                                 +++++++++++++++++
89
90error[E0277]: the size for values of type `Self` cannot be known at compilation time
91  --> $DIR/adt-param-with-implicit-sized-bound.rs:5:19
92   |
93LL |     fn func4() -> Struct4<Self>;
94   |                   ^^^^^^^^^^^^^ doesn't have a size known at compile-time
95   |
96note: required by a bound in `Struct4`
97  --> $DIR/adt-param-with-implicit-sized-bound.rs:20:16
98   |
99LL | struct Struct4<T>{
100   |                ^ required by this bound in `Struct4`
101help: consider further restricting `Self`
102   |
103LL |     fn func4() -> Struct4<Self> where Self: Sized;
104   |                                 +++++++++++++++++
105help: consider relaxing the implicit `Sized` restriction
106   |
107LL | struct Struct4<T: ?Sized>{
108   |                 ++++++++
109
110error: aborting due to 5 previous errors
111
112For more information about this error, try `rustc --explain E0277`.