about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2021-03-14 21:29:34 +0100
committerCamille GILLOT <gillot.camille@gmail.com>2021-03-14 21:47:42 +0100
commite8b2e7b01ce9415f448318e4acc161195efcfbb6 (patch)
treedd44a521b4b5c582557630eae24bc94bed74105d
parent17d3308d3fe64bf402a6bfabcc16a62a702a2ba7 (diff)
downloadrust-e8b2e7b01ce9415f448318e4acc161195efcfbb6.tar.gz
rust-e8b2e7b01ce9415f448318e4acc161195efcfbb6.zip
Assert there is no duplicate node.
-rw-r--r--compiler/rustc_middle/src/hir/map/collector.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_middle/src/hir/map/collector.rs b/compiler/rustc_middle/src/hir/map/collector.rs
index b1dd405a6be..7c2c2d13e98 100644
--- a/compiler/rustc_middle/src/hir/map/collector.rs
+++ b/compiler/rustc_middle/src/hir/map/collector.rs
@@ -52,6 +52,7 @@ fn insert_vec_map<K: Idx, V: Clone>(map: &mut IndexVec<K, Option<V>>, k: K, v: V
     if i >= len {
         map.extend(repeat(None).take(i - len + 1));
     }
+    debug_assert!(map[k].is_none());
     map[k] = Some(v);
 }
 
@@ -216,9 +217,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
             // Overwrite the dummy hash with the real HIR owner hash.
             nodes.hash = hash;
 
-            // FIXME: feature(impl_trait_in_bindings) broken and trigger this assert
-            //assert!(data.signature.is_none());
-
+            debug_assert!(data.signature.is_none());
             data.signature =
                 Some(self.arena.alloc(Owner { parent: entry.parent, node: entry.node }));
         } else {