]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/ty/maps.rs
Merge branch 'hide-trait-map' into rollup
[rust.git] / src / librustc / ty / maps.rs
index 1d1b95e270f5f86abee02cc11d15d12bf4db5bdf..da81bfbb0dc4f21643d0cd99356d1f9270108d73 100644 (file)
@@ -549,6 +549,12 @@ fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
     }
 }
 
+impl<'tcx> QueryDescription for queries::specializes<'tcx> {
+    fn describe(_tcx: TyCtxt, _: (DefId, DefId)) -> String {
+        format!("computing whether impls specialize one another")
+    }
+}
+
 impl<'tcx> QueryDescription for queries::in_scope_traits<'tcx> {
     fn describe(_tcx: TyCtxt, _: HirId) -> String {
         format!("fetching the traits in scope at a particular ast node")
@@ -1130,6 +1136,7 @@ fn default() -> Self {
 
     [] lint_levels: lint_levels(CrateNum) -> Rc<lint::LintLevelMap>,
 
+    [] specializes: specializes_node((DefId, DefId)) -> bool,
     [] in_scope_traits: InScopeTraits(HirId) -> Option<Rc<Vec<TraitCandidate>>>,
     [] module_exports: ModuleExports(HirId) -> Option<Rc<Vec<Export>>>,
 }
@@ -1207,3 +1214,7 @@ fn layout_dep_node<'tcx>(_: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> DepConstructor<'
 fn lint_levels<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
     DepConstructor::LintLevels
 }
+
+fn specializes_node<'tcx>((a, b): (DefId, DefId)) -> DepConstructor<'tcx> {
+    DepConstructor::Specializes { impl1: a, impl2: b }
+}