diff options
| author | Ralf Jung <post@ralfj.de> | 2018-08-20 22:39:08 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2018-08-22 13:08:40 +0200 |
| commit | 14dc780d8978ff796c427290b4e7336c90dfc2e7 (patch) | |
| tree | 756b3b58a59c9d4ee3bf6970d67a24a09f517ece | |
| parent | f3e7efc8c17b920122de4a317ab788e2eb65f3ee (diff) | |
| download | rust-14dc780d8978ff796c427290b4e7336c90dfc2e7.tar.gz rust-14dc780d8978ff796c427290b4e7336c90dfc2e7.zip | |
fix a comment in validity
| -rw-r--r-- | src/librustc_mir/interpret/validity.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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 |
