about summary refs log tree commit diff
path: root/compiler/rustc_const_eval
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-07-17 10:47:34 -0400
committerRalf Jung <post@ralfj.de>2022-07-17 10:47:34 -0400
commite6be52bbbde9043385ecc5a4e2460fa85daba9c9 (patch)
tree0f9ada83f27dbca14ca425e62ab9cda574765fc3 /compiler/rustc_const_eval
parent967a9c94b34bb8f394db03b1d205831eddf6f589 (diff)
downloadrust-e6be52bbbde9043385ecc5a4e2460fa85daba9c9.tar.gz
rust-e6be52bbbde9043385ecc5a4e2460fa85daba9c9.zip
interpret/visitor: add missing early return
Diffstat (limited to 'compiler/rustc_const_eval')
-rw-r--r--compiler/rustc_const_eval/src/interpret/visitor.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/visitor.rs b/compiler/rustc_const_eval/src/interpret/visitor.rs
index f6a0c19d259..3f6e8a8f755 100644
--- a/compiler/rustc_const_eval/src/interpret/visitor.rs
+++ b/compiler/rustc_const_eval/src/interpret/visitor.rs
@@ -473,6 +473,9 @@ macro_rules! make_value_visitor {
                         // The second `Box` field is the allocator, which we recursively check for validity
                         // like in regular structs.
                         self.visit_field(v, 1, &alloc)?;
+
+                        // We visited all parts of this one.
+                        return Ok(());
                     }
                     _ => {},
                 };