]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/ich/hcx.rs
Merge branch 'hide-trait-map' into rollup
[rust.git] / src / librustc / ich / hcx.rs
index 544c824f83ce2f9e4c048da32ac0efce704d6577..9c841022fcb8225df851b314d6473c3f702d393c 100644 (file)
@@ -205,13 +205,15 @@ fn hash_stable<W: StableHasherResult>(&self,
                 // corresponding entry in the `trait_map` we need to hash that.
                 // Make sure we don't ignore too much by checking that there is
                 // no entry in a debug_assert!().
-                debug_assert!(hcx.tcx.trait_map.get(self).is_none());
+                let hir_id = hcx.tcx.hir.node_to_hir_id(*self);
+                debug_assert!(hcx.tcx.in_scope_traits(hir_id).is_none());
             }
             NodeIdHashingMode::HashDefPath => {
                 hcx.tcx.hir.definitions().node_to_hir_id(*self).hash_stable(hcx, hasher);
             }
             NodeIdHashingMode::HashTraitsInScope => {
-                if let Some(traits) = hcx.tcx.trait_map.get(self) {
+                let hir_id = hcx.tcx.hir.node_to_hir_id(*self);
+                if let Some(traits) = hcx.tcx.in_scope_traits(hir_id) {
                     // The ordering of the candidates is not fixed. So we hash
                     // the def-ids and then sort them and hash the collection.
                     let mut candidates: AccumulateVec<[_; 8]> =