X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_mir%2Fsrc%2Ftransform%2Fmod.rs;h=2201223e13eabd92b0314a4bd20ed5c01b3ddae0;hb=cc77ba46fcb2d288aa01554b48cd586c5827c3dd;hp=5c49ee69edc51622a24aec74be2f1bf6733e583e;hpb=3cbed892a717dfc92845017b2f6c11d43fe48c0d;p=rust.git diff --git a/compiler/rustc_mir/src/transform/mod.rs b/compiler/rustc_mir/src/transform/mod.rs index 5c49ee69edc..2201223e13e 100644 --- a/compiler/rustc_mir/src/transform/mod.rs +++ b/compiler/rustc_mir/src/transform/mod.rs @@ -3,7 +3,7 @@ use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::steal::Steal; use rustc_hir as hir; -use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE}; +use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor}; use rustc_index::vec::IndexVec; use rustc_middle::mir::visit::Visitor as _; @@ -98,14 +98,13 @@ pub(crate) fn provide(providers: &mut Providers) { } fn is_mir_available(tcx: TyCtxt<'_>, def_id: DefId) -> bool { - tcx.mir_keys(def_id.krate).contains(&def_id.expect_local()) + let def_id = def_id.expect_local(); + tcx.mir_keys(()).contains(&def_id) } /// Finds the full set of `DefId`s within the current crate that have /// MIR associated with them. -fn mir_keys(tcx: TyCtxt<'_>, krate: CrateNum) -> FxHashSet { - assert_eq!(krate, LOCAL_CRATE); - +fn mir_keys(tcx: TyCtxt<'_>, (): ()) -> FxHashSet { let mut set = FxHashSet::default(); // All body-owners have MIR associated with them.