From 8e7cbc28a65df0e979b6052db7f4f8d26fecd9d9 Mon Sep 17 00:00:00 2001 From: Tyson Nottingham Date: Mon, 11 Jan 2021 13:31:43 -0800 Subject: Prevent potential bug resulting from changing crate_hash query name --- compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_metadata/src/rmeta/decoder') diff --git a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs index 85507b8f843..f50c84adb26 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs @@ -47,7 +47,8 @@ macro_rules! provide { // External query providers call `crate_hash` in order to register a dependency // on the crate metadata. The exception is `crate_hash` itself, which obviously // doesn't need to do this (and can't, as it would cause a query cycle). - if stringify!($name) != "crate_hash" && $tcx.dep_graph.is_fully_enabled() { + use rustc_middle::dep_graph::DepKind; + if DepKind::$name != DepKind::crate_hash && $tcx.dep_graph.is_fully_enabled() { $tcx.ensure().crate_hash($def_id.krate); } -- cgit 1.4.1-3-g733a5