about summary refs log tree commit diff
path: root/src/librustc_middle
diff options
context:
space:
mode:
authorBastian Kauschke <bastian_kauschke@hotmail.de>2020-06-27 13:15:12 +0200
committerBastian Kauschke <bastian_kauschke@hotmail.de>2020-06-27 13:15:12 +0200
commit1875c797721a84b3a4cbb77d4e4bd0a367ff22c3 (patch)
tree3cfa3bfeabc17fcf5d7a8eb486995a646d1fdfe9 /src/librustc_middle
parenta4e7b4798405917560a224b6e9f2eab07524e0b7 (diff)
downloadrust-1875c797721a84b3a4cbb77d4e4bd0a367ff22c3.tar.gz
rust-1875c797721a84b3a4cbb77d4e4bd0a367ff22c3.zip
more LocalDefId in ty::context
Diffstat (limited to 'src/librustc_middle')
-rw-r--r--src/librustc_middle/ty/context.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/librustc_middle/ty/context.rs b/src/librustc_middle/ty/context.rs
index df08e083d2c..fb89e0e41d9 100644
--- a/src/librustc_middle/ty/context.rs
+++ b/src/librustc_middle/ty/context.rs
@@ -1436,8 +1436,11 @@ impl<'tcx> TyCtxt<'tcx> {
     }
 
     /// Given a `DefId` for an `fn`, return all the `dyn` and `impl` traits in its return type.
-    pub fn return_type_impl_or_dyn_traits(&self, scope_def_id: DefId) -> Vec<&'tcx hir::Ty<'tcx>> {
-        let hir_id = self.hir().as_local_hir_id(scope_def_id.expect_local());
+    pub fn return_type_impl_or_dyn_traits(
+        &self,
+        scope_def_id: LocalDefId,
+    ) -> Vec<&'tcx hir::Ty<'tcx>> {
+        let hir_id = self.hir().as_local_hir_id(scope_def_id);
         let hir_output = match self.hir().get(hir_id) {
             Node::Item(hir::Item {
                 kind:
@@ -1480,9 +1483,9 @@ impl<'tcx> TyCtxt<'tcx> {
         v.0
     }
 
-    pub fn return_type_impl_trait(&self, scope_def_id: DefId) -> Option<(Ty<'tcx>, Span)> {
+    pub fn return_type_impl_trait(&self, scope_def_id: LocalDefId) -> Option<(Ty<'tcx>, Span)> {
         // HACK: `type_of_def_id()` will fail on these (#55796), so return `None`.
-        let hir_id = self.hir().as_local_hir_id(scope_def_id.expect_local());
+        let hir_id = self.hir().as_local_hir_id(scope_def_id);
         match self.hir().get(hir_id) {
             Node::Item(item) => {
                 match item.kind {