Skip to content

Commit e3f5db0

Browse files
RalfJungzachs18
authored andcommitted
fine-tune comment
1 parent 6493cd8 commit e3f5db0

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

compiler/rustc_const_eval/src/interpret/validity.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -1264,12 +1264,11 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValueVisitor<'tcx, M> for ValidityVisitor<'rt,
12641264
}
12651265
}
12661266

1267-
// *After* all of this, check the ABI. We need to check the ABI to handle
1268-
// types like `NonNull` where the `Scalar` info is more restrictive than what
1269-
// the fields say (`rustc_layout_scalar_valid_range_start`).
1270-
// But in most cases, this will just propagate what the fields say,
1271-
// and then we want the error to point at the field -- so, first recurse,
1272-
// then check ABI.
1267+
// *After* all of this, check further information stored in the layout. We need to check
1268+
// this to handle types like `NonNull` where the `Scalar` info is more restrictive than what
1269+
// the fields say (`rustc_layout_scalar_valid_range_start`). But in most cases, this will
1270+
// just propagate what the fields say, and then we want the error to point at the field --
1271+
// so, we first recurse, then we do this check.
12731272
//
12741273
// FIXME: We could avoid some redundant checks here. For newtypes wrapping
12751274
// scalars, we do the same check on every "level" (e.g., first we check

0 commit comments

Comments
 (0)