Skip to content

Commit 4e755a9

Browse files
committed
Adjust documentation
1 parent ea188e9 commit 4e755a9

File tree

1 file changed

+5
-5
lines changed
  • compiler/rustc_error_codes/src/error_codes

1 file changed

+5
-5
lines changed

compiler/rustc_error_codes/src/error_codes/E0690.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
A struct with the representation hint `repr(transparent)` had zero or more than
2-
one fields that were not guaranteed to be zero-sized.
1+
A struct with the representation hint `repr(transparent)` had two or more fields
2+
that were not guaranteed to be zero-sized.
33

44
Erroneous code example:
55

66
```compile_fail,E0690
77
#[repr(transparent)]
8-
struct LengthWithUnit<U> { // error: transparent struct needs exactly one
8+
struct LengthWithUnit<U> { // error: transparent struct needs at most one
99
value: f32, // non-zero-sized field, but has 2
1010
unit: U,
1111
}
1212
```
1313

1414
Because transparent structs are represented exactly like one of their fields at
15-
run time, said field must be uniquely determined. If there is no field, or if
16-
there are multiple fields, it is not clear how the struct should be represented.
15+
run time, said field must be uniquely determined. If there are multiple fields,
16+
it is not clear how the struct should be represented.
1717
Note that fields of zero-sized types (e.g., `PhantomData`) can also exist
1818
alongside the field that contains the actual data, they do not count for this
1919
error. When generic types are involved (as in the above example), an error is

0 commit comments

Comments
 (0)