From 6ae3888b19e40e9c4761c1a443d77eba63e94840 Mon Sep 17 00:00:00 2001 From: marmeladema Date: Wed, 8 Apr 2020 09:23:58 +0100 Subject: [PATCH] librustc_resolve: fixup nit in previous commit --- src/librustc_resolve/build_reduced_graph.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index 506b6657b44f3..0ad33f1a120c7 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -26,7 +26,7 @@ use rustc_errors::{struct_span_err, Applicability}; use rustc_expand::base::SyntaxExtension; use rustc_expand::expand::AstFragment; use rustc_hir::def::{self, *}; -use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX, LOCAL_CRATE}; +use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX}; use rustc_metadata::creader::LoadedMacro; use rustc_middle::bug; use rustc_middle::hir::exports::Export; @@ -96,8 +96,8 @@ impl<'a> Resolver<'a> { } crate fn get_module(&mut self, def_id: DefId) -> Module<'a> { - if def_id.krate == LOCAL_CRATE { - return self.module_map[&def_id.as_local().unwrap()]; + if let Some(def_id) = def_id.as_local() { + return self.module_map[&def_id]; } if let Some(&module) = self.extern_module_map.get(&def_id) {