X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc%2Fmir%2Fmono.rs;h=51ce575e51f3b61aaec5fdd72cfc51d831a1abab;hb=29951edbdfcb3e65e689e43c997a98d8aad5e273;hp=bec98221e5af3a2a6412dc2c2ae5296b39f4feca;hpb=0bbe11089ccdb575d3f7d5a6c83eb3d2810eef29;p=rust.git diff --git a/src/librustc/mir/mono.rs b/src/librustc/mir/mono.rs index bec98221e5a..475c77adebd 100644 --- a/src/librustc/mir/mono.rs +++ b/src/librustc/mir/mono.rs @@ -1,13 +1,13 @@ use crate::dep_graph::{DepConstructor, DepNode, WorkProduct, WorkProductId}; -use crate::hir::def_id::{CrateNum, DefId, LOCAL_CRATE}; -use crate::hir::HirId; use crate::ich::{Fingerprint, NodeIdHashingMode, StableHashingContext}; use crate::session::config::OptLevel; use crate::ty::print::obsolete::DefPathBasedNames; use crate::ty::{subst::InternalSubsts, Instance, InstanceDef, SymbolName, TyCtxt}; -use crate::util::nodemap::FxHashMap; use rustc_data_structures::base_n; +use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; +use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE}; +use rustc_hir::HirId; use rustc_span::source_map::Span; use rustc_span::symbol::Symbol; use std::fmt; @@ -79,7 +79,7 @@ pub fn symbol_name(&self, tcx: TyCtxt<'tcx>) -> SymbolName { } pub fn instantiation_mode(&self, tcx: TyCtxt<'tcx>) -> InstantiationMode { - let inline_in_all_cgus = tcx + let generate_cgu_internal_copies = tcx .sess .opts .debugging_opts @@ -93,7 +93,7 @@ pub fn instantiation_mode(&self, tcx: TyCtxt<'tcx>) -> InstantiationMode { // If this function isn't inlined or otherwise has explicit // linkage, then we'll be creating a globally shared version. if self.explicit_linkage(tcx).is_some() - || !instance.def.requires_local(tcx) + || !instance.def.generates_cgu_internal_copy(tcx) || Some(instance.def_id()) == entry_def_id { return InstantiationMode::GloballyShared { may_conflict: false }; @@ -102,7 +102,7 @@ pub fn instantiation_mode(&self, tcx: TyCtxt<'tcx>) -> InstantiationMode { // At this point we don't have explicit linkage and we're an // inlined function. If we're inlining into all CGUs then we'll // be creating a local copy per CGU - if inline_in_all_cgus { + if generate_cgu_internal_copies { return InstantiationMode::LocalCopy; }