Skip to content

Commit 45053d1

Browse files
Clean up E0374 explanation
1 parent abc3073 commit 45053d1

File tree

1 file changed

+8
-6
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+8
-6
lines changed

src/librustc_error_codes/error_codes/E0374.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
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.
73

84
Example of erroneous code:
95

@@ -20,6 +16,12 @@ impl<T, U> CoerceUnsized<Foo<U>> for Foo<T>
2016
where T: CoerceUnsized<U> {}
2117
```
2218

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+
2325
`CoerceUnsized` is used to coerce one struct containing an unsized type
2426
into another struct containing a different unsized type. If the struct
2527
doesn't have any fields of unsized types then you don't need explicit

0 commit comments

Comments
 (0)