You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
compiler/hir/check: clarify error message on transparent ADT
Replace the phrase "layout of non-zero size or alignment larger than 1"
with "non-trivial layout", and then elaborate that a layout is trivial
if, and only if, it is zero-sized with an alignment of 1.
Additionally, add a comment to the check-function explaining which
information is gathered to check transparent ADTs, and elaborate why it
is needed.
Copy file name to clipboardExpand all lines: compiler/rustc_hir_analysis/messages.ftl
+6-4
Original file line number
Diff line number
Diff line change
@@ -270,15 +270,17 @@ hir_analysis_transparent_enum_variant = transparent enum needs exactly one varia
270
270
.many_label = too many variants in `{$path}`
271
271
.multi_label = variant here
272
272
273
-
hir_analysis_transparent_layout = transparent {$desc} needs at most one field of non-zero size or alignment larger than 1, but has {$field_count}
274
-
.label = needs at most one field of non-zero size or alignment larger than 1, but has {$field_count}
273
+
hir_analysis_transparent_layout = transparent {$desc} needs at most one field with non-trivial layout, but has {$field_count}
274
+
.label = needs at most one field with non-trivial layout, but has {$field_count}
275
275
.non_layout_labels = this field may have an alignment larger than 1
276
276
.non_zst_labels = this field is non-zero-sized
277
+
.note = a layout is trivial if, any only if, it is zero-sized with an alignment of 1
277
278
278
-
hir_analysis_transparent_layout_enum = the variant of a transparent {$desc} needs at most one field of non-zero size or alignment larger than 1, but has {$field_count}
279
-
.label = needs at most one field of non-zero size or alignment larger than 1, but has {$field_count}
279
+
hir_analysis_transparent_layout_enum = the variant of a transparent {$desc} needs at most one field with non-trivial layout, but has {$field_count}
280
+
.label = needs at most one field with non-trivial layout, but has {$field_count}
280
281
.non_layout_labels = this field may have an alignment larger than 1
281
282
.non_zst_labels = this field is non-zero-sized
283
+
.note = a layout is trivial if, any only if, it is zero-sized with an alignment of 1
0 commit comments