From 14dc780d8978ff796c427290b4e7336c90dfc2e7 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 20 Aug 2018 22:39:08 +0200 Subject: [PATCH] fix a comment in validity --- src/librustc_mir/interpret/validity.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/librustc_mir/interpret/validity.rs b/src/librustc_mir/interpret/validity.rs index 1f6e10913aa..c28c3b4d3f1 100644 --- a/src/librustc_mir/interpret/validity.rs +++ b/src/librustc_mir/interpret/validity.rs @@ -226,7 +226,9 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> { // Validate all fields match dest.layout.fields { // primitives are unions with zero fields - // FIXME: Use some other indicator instead, like `layout.abi`. + // We still check `layout.fields`, not `layout.abi`, because `layout.abi` + // is `Scalar` for newtypes around scalars, but we want to descend through the + // fields to get a proper `path`. layout::FieldPlacement::Union(0) => { match dest.layout.abi { // nothing to do, whatever the pointer points to, it is never going to be read