summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/rmeta/decoder
diff options
context:
space:
mode:
authorTyson Nottingham <tgnottingham@gmail.com>2021-01-11 13:31:43 -0800
committerTyson Nottingham <tgnottingham@gmail.com>2021-01-12 11:22:58 -0800
commit8e7cbc28a65df0e979b6052db7f4f8d26fecd9d9 (patch)
treee0234d48477656f5725b78e28293299fd4f389a8 /compiler/rustc_metadata/src/rmeta/decoder
parent0962e5eba91cc873b2546d1b727dcddd33fde6a8 (diff)
downloadrust-8e7cbc28a65df0e979b6052db7f4f8d26fecd9d9.tar.gz
rust-8e7cbc28a65df0e979b6052db7f4f8d26fecd9d9.zip
Prevent potential bug resulting from changing crate_hash query name
Diffstat (limited to 'compiler/rustc_metadata/src/rmeta/decoder')
-rw-r--r--compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs3
1 files changed, 2 insertions, 1 deletions
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);
                 }