1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
error[E0802]: `CoercePointee` can only be derived on `struct`s with `#[repr(transparent)]`
--> $DIR/deriving-coerce-pointee-neg.rs:9:10
|
LL | #[derive(CoercePointee)]
| ^^^^^^^^^^^^^
error[E0802]: `CoercePointee` can only be derived on `struct`s with at least one field
--> $DIR/deriving-coerce-pointee-neg.rs:15:10
|
LL | #[derive(CoercePointee)]
| ^^^^^^^^^^^^^
error[E0802]: `CoercePointee` can only be derived on `struct`s with at least one field
--> $DIR/deriving-coerce-pointee-neg.rs:22:10
|
LL | #[derive(CoercePointee)]
| ^^^^^^^^^^^^^
error[E0802]: `CoercePointee` can only be derived on `struct`s that are generic over at least one type
--> $DIR/deriving-coerce-pointee-neg.rs:29:10
|
LL | #[derive(CoercePointee)]
| ^^^^^^^^^^^^^
error[E0802]: exactly one generic type parameter must be marked as `#[pointee]` to derive `CoercePointee` traits
--> $DIR/deriving-coerce-pointee-neg.rs:34:10
|
LL | #[derive(CoercePointee)]
| ^^^^^^^^^^^^^
error[E0802]: only one type parameter can be marked as `#[pointee]` when deriving `CoercePointee` traits
--> $DIR/deriving-coerce-pointee-neg.rs:43:39
|
LL | struct TooManyPointees<'a, #[pointee] A: ?Sized, #[pointee] B: ?Sized>((&'a A, &'a B));
| ^ - here another type parameter is marked as `#[pointee]`
error[E0802]: `derive(CoercePointee)` requires `T` to be marked `?Sized`
--> $DIR/deriving-coerce-pointee-neg.rs:54:36
|
LL | struct NoMaybeSized<'a, #[pointee] T> {
| ^
error: the `#[pointee]` attribute may only be used on generic parameters
--> $DIR/deriving-coerce-pointee-neg.rs:62:5
|
LL | #[pointee]
| ^^^^^^^^^^
error: the `#[pointee]` attribute may only be used on generic parameters
--> $DIR/deriving-coerce-pointee-neg.rs:72:33
|
LL | struct UhOh<#[pointee] T>(T);
| ^^^^^^^^^^
error: the `#[pointee]` attribute may only be used on generic parameters
--> $DIR/deriving-coerce-pointee-neg.rs:86:21
|
LL | struct UhOh<#[pointee] T>(T);
| ^^^^^^^^^^
error: the `#[pointee]` attribute may only be used on generic parameters
--> $DIR/deriving-coerce-pointee-neg.rs:101:25
|
LL | struct UhOh<#[pointee] T>(T);
| ^^^^^^^^^^
error[E0392]: lifetime parameter `'a` is never used
--> $DIR/deriving-coerce-pointee-neg.rs:18:16
|
LL | struct NoField<'a, #[pointee] T: ?Sized> {}
| ^^ unused lifetime parameter
|
= help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
error[E0392]: type parameter `T` is never used
--> $DIR/deriving-coerce-pointee-neg.rs:18:31
|
LL | struct NoField<'a, #[pointee] T: ?Sized> {}
| ^ unused type parameter
|
= help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
error[E0392]: lifetime parameter `'a` is never used
--> $DIR/deriving-coerce-pointee-neg.rs:25:20
|
LL | struct NoFieldUnit<'a, #[pointee] T: ?Sized>();
| ^^ unused lifetime parameter
|
= help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
error[E0392]: type parameter `T` is never used
--> $DIR/deriving-coerce-pointee-neg.rs:25:35
|
LL | struct NoFieldUnit<'a, #[pointee] T: ?Sized>();
| ^ unused type parameter
|
= help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
error[E0802]: `derive(CoercePointee)` is only applicable to `struct` with `repr(transparent)` layout
--> $DIR/deriving-coerce-pointee-neg.rs:47:1
|
LL | struct NotTransparent<'a, #[pointee] T: ?Sized> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0802]: `derive(CoercePointee)` is only applicable to `struct` with `repr(transparent)` layout
--> $DIR/deriving-coerce-pointee-neg.rs:140:1
|
LL | struct TryToWipeRepr<'a, #[pointee] T: ?Sized> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: for `RcWithId<T>` to have a valid implementation of `CoerceUnsized`, it must be possible to coerce the field of type `Rc<(i32, Box<T>)>`
--> $DIR/deriving-coerce-pointee-neg.rs:146:10
|
LL | #[derive(CoercePointee)]
| ^^^^^^^^^^^^^
...
LL | inner: std::rc::Rc<(i32, Box<T>)>,
| --------------------------------- `Rc<(i32, Box<T>)>` must be a pointer, reference, or smart pointer that is allowed to be unsized
error[E0375]: implementing `CoerceUnsized` does not allow multiple fields to be coerced
--> $DIR/deriving-coerce-pointee-neg.rs:153:10
|
LL | #[derive(CoercePointee)]
| ^^^^^^^^^^^^^
|
note: the trait `CoerceUnsized` may only be implemented when a single field is being coerced
--> $DIR/deriving-coerce-pointee-neg.rs:157:5
|
LL | inner1: Box<T>,
| ^^^^^^^^^^^^^^
LL | inner2: Box<T>,
| ^^^^^^^^^^^^^^
error: for `UsingNonCoercePointeeData<T>` to have a valid implementation of `CoerceUnsized`, it must be possible to coerce the field of type `NotCoercePointeeData<T>`
--> $DIR/deriving-coerce-pointee-neg.rs:164:10
|
LL | #[derive(CoercePointee)]
| ^^^^^^^^^^^^^
LL |
LL | struct UsingNonCoercePointeeData<T: ?Sized>(NotCoercePointeeData<T>);
| ----------------------- `NotCoercePointeeData<T>` must be a pointer, reference, or smart pointer that is allowed to be unsized
error[E0690]: transparent struct needs at most one field with non-trivial size or alignment, but has 2
--> $DIR/deriving-coerce-pointee-neg.rs:155:1
|
LL | struct MoreThanOneField<T: ?Sized> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ needs at most one field with non-trivial size or alignment, but has 2
LL |
LL | inner1: Box<T>,
| -------------- this field has non-zero size or requires alignment
LL | inner2: Box<T>,
| -------------- this field has non-zero size or requires alignment
error: aborting due to 21 previous errors
Some errors have detailed explanations: E0375, E0392, E0690, E0802.
For more information about an error, try `rustc --explain E0375`.
|