Skip to content

Commit fcf6b5c

Browse files
committed
add fixme for potential perf optimization
1 parent e09e3c8 commit fcf6b5c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustc_mir/interpret/validity.rs

+3
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,9 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
419419
// Things can be aggregates and have scalar layout at the same time, and that
420420
// is very relevant for `NonNull` and similar structs: We need to validate them
421421
// at their scalar layout *before* descending into their fields.
422+
// FIXME: We could avoid some redundant checks here. For newtypes wrapping
423+
// scalars, we do the same check on every "level" (e.g. first we check
424+
// MyNewtype and then the scalar in there).
422425
match dest.layout.abi {
423426
layout::Abi::Uninhabited =>
424427
return validation_failure!("a value of an uninhabited type", path),

0 commit comments

Comments
 (0)