]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_error_codes/error_codes/E0375.md
Rollup merge of #70038 - DutchGhost:const-forget-tests, r=RalfJung
[rust.git] / src / librustc_error_codes / error_codes / E0375.md
index 31fcd85cb079f6d60e23a523f933e52b83130557..71e530571650b53357047ff647ec0337e7327315 100644 (file)
@@ -1,12 +1,7 @@
-A struct with more than one field containing an unsized type cannot implement
-`CoerceUnsized`. This only occurs when you are trying to coerce one of the
-types in your struct to another type in the struct. In this case we try to
-impl `CoerceUnsized` from `T` to `U` which are both types that the struct
-takes. An [unsized type][1] is any type that the compiler doesn't know the
-length or alignment of at compile time. Any struct containing an unsized type
-is also unsized.
+`CoerceUnsized` was implemented on a struct which contains more than one field
+with an unsized type.
 
-Example of erroneous code:
+Erroneous code example:
 
 ```compile_fail,E0375
 #![feature(coerce_unsized)]
@@ -22,6 +17,14 @@ struct Foo<T: ?Sized, U: ?Sized> {
 impl<T, U> CoerceUnsized<Foo<U, T>> for Foo<T, U> {}
 ```
 
+A struct with more than one field containing an unsized type cannot implement
+`CoerceUnsized`. This only occurs when you are trying to coerce one of the
+types in your struct to another type in the struct. In this case we try to
+impl `CoerceUnsized` from `T` to `U` which are both types that the struct
+takes. An [unsized type][1] is any type that the compiler doesn't know the
+length or alignment of at compile time. Any struct containing an unsized type
+is also unsized.
+
 `CoerceUnsized` only allows for coercion from a structure with a single
 unsized type field to another struct with a single unsized type field.
 In fact Rust only allows for a struct to have one unsized type in a struct