about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/query/plumbing.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_middle/src/query/plumbing.rs')
-rw-r--r--compiler/rustc_middle/src/query/plumbing.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/query/plumbing.rs b/compiler/rustc_middle/src/query/plumbing.rs
index 97edfc2fca2..a1aac284621 100644
--- a/compiler/rustc_middle/src/query/plumbing.rs
+++ b/compiler/rustc_middle/src/query/plumbing.rs
@@ -545,6 +545,7 @@ macro_rules! define_feedable {
 
 mod sealed {
     use super::{DefId, LocalDefId, OwnerId};
+    use rustc_hir::def_id::{LocalModDefId, ModDefId};
 
     /// An analogue of the `Into` trait that's intended only for query parameters.
     ///
@@ -588,6 +589,27 @@ mod sealed {
             self.to_def_id()
         }
     }
+
+    impl IntoQueryParam<DefId> for ModDefId {
+        #[inline(always)]
+        fn into_query_param(self) -> DefId {
+            self.to_def_id()
+        }
+    }
+
+    impl IntoQueryParam<DefId> for LocalModDefId {
+        #[inline(always)]
+        fn into_query_param(self) -> DefId {
+            self.to_def_id()
+        }
+    }
+
+    impl IntoQueryParam<LocalDefId> for LocalModDefId {
+        #[inline(always)]
+        fn into_query_param(self) -> LocalDefId {
+            self.into()
+        }
+    }
 }
 
 pub use sealed::IntoQueryParam;