Skip to content

Commit 14dc780

Browse files
committed
fix a comment in validity
1 parent f3e7efc commit 14dc780

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustc_mir/interpret/validity.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,9 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
226226
// Validate all fields
227227
match dest.layout.fields {
228228
// primitives are unions with zero fields
229-
// FIXME: Use some other indicator instead, like `layout.abi`.
229+
// We still check `layout.fields`, not `layout.abi`, because `layout.abi`
230+
// is `Scalar` for newtypes around scalars, but we want to descend through the
231+
// fields to get a proper `path`.
230232
layout::FieldPlacement::Union(0) => {
231233
match dest.layout.abi {
232234
// nothing to do, whatever the pointer points to, it is never going to be read

0 commit comments

Comments
 (0)