]> git.lizzy.rs Git - rust.git/commitdiff
Assert there is no duplicate node.
authorCamille GILLOT <gillot.camille@gmail.com>
Sun, 14 Mar 2021 20:29:34 +0000 (21:29 +0100)
committerCamille GILLOT <gillot.camille@gmail.com>
Sun, 14 Mar 2021 20:47:42 +0000 (21:47 +0100)
compiler/rustc_middle/src/hir/map/collector.rs

index b1dd405a6be6880187aa759b893d8407ccc9424c..7c2c2d13e981476654eee37fccdc5d6f08209c86 100644 (file)
@@ -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 @@ fn insert_entry(&mut self, id: HirId, entry: Entry<'hir>, hash: Fingerprint) {
             // 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 {