File tree 1 file changed +8
-6
lines changed
src/librustc_error_codes/error_codes
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
- A struct without a field containing an unsized type cannot implement
2
- ` CoerceUnsized ` . An [ unsized type] [ 1 ] is any type that the compiler
3
- doesn't know the length or alignment of at compile time. Any struct
4
- containing an unsized type is also unsized.
5
-
6
- [ 1 ] : https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait
1
+ ` CoerceUnsized ` was implemented on a struct which does not contain a field with
2
+ an unsized type.
7
3
8
4
Example of erroneous code:
9
5
@@ -20,6 +16,12 @@ impl<T, U> CoerceUnsized<Foo<U>> for Foo<T>
20
16
where T: CoerceUnsized<U> {}
21
17
```
22
18
19
+ An [ unsized type] [ 1 ] is any type where the compiler does not know the length or
20
+ alignment of at compile time. Any struct containing an unsized type is also
21
+ unsized.
22
+
23
+ [ 1 ] : https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait
24
+
23
25
` CoerceUnsized ` is used to coerce one struct containing an unsized type
24
26
into another struct containing a different unsized type. If the struct
25
27
doesn't have any fields of unsized types then you don't need explicit
You can’t perform that action at this time.
0 commit comments