diff options
| author | Ralf Jung <post@ralfj.de> | 2018-10-04 20:04:16 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2018-10-09 13:08:00 +0200 |
| commit | fcf6b5c79bdc69f0daa894605d42c271336af8a6 (patch) | |
| tree | b24edebbee6be7af7675ee61427e17cccec6efbc | |
| parent | e09e3c898cbc371e8c3f9e6f1be5417b30daa24a (diff) | |
| download | rust-fcf6b5c79bdc69f0daa894605d42c271336af8a6.tar.gz rust-fcf6b5c79bdc69f0daa894605d42c271336af8a6.zip | |
add fixme for potential perf optimization
| -rw-r--r-- | src/librustc_mir/interpret/validity.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustc_mir/interpret/validity.rs b/src/librustc_mir/interpret/validity.rs index f0a51000cd8..9e833598ef1 100644 --- a/src/librustc_mir/interpret/validity.rs +++ b/src/librustc_mir/interpret/validity.rs @@ -419,6 +419,9 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> // Things can be aggregates and have scalar layout at the same time, and that // is very relevant for `NonNull` and similar structs: We need to validate them // at their scalar layout *before* descending into their fields. + // FIXME: We could avoid some redundant checks here. For newtypes wrapping + // scalars, we do the same check on every "level" (e.g. first we check + // MyNewtype and then the scalar in there). match dest.layout.abi { layout::Abi::Uninhabited => return validation_failure!("a value of an uninhabited type", path), |
