summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_symbol_mangling/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_symbol_mangling/src/lib.rs')
-rw-r--r--compiler/rustc_symbol_mangling/src/lib.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_symbol_mangling/src/lib.rs b/compiler/rustc_symbol_mangling/src/lib.rs
index 547a59076..d9ce73734 100644
--- a/compiler/rustc_symbol_mangling/src/lib.rs
+++ b/compiler/rustc_symbol_mangling/src/lib.rs
@@ -100,8 +100,10 @@ extern crate rustc_middle;
#[macro_use]
extern crate tracing;
+use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage};
use rustc_hir::def::DefKind;
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
+use rustc_macros::fluent_messages;
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs;
use rustc_middle::mir::mono::{InstantiationMode, MonoItem};
@@ -117,6 +119,8 @@ pub mod errors;
pub mod test;
pub mod typeid;
+fluent_messages! { "../locales/en-US.ftl" }
+
/// This function computes the symbol name for the given `instance` and the
/// given instantiating crate. That is, if you know that instance X is
/// instantiated in crate Y, this is the symbol name this instance would have.
@@ -244,8 +248,7 @@ fn compute_symbol_name<'tcx>(
// project.
let avoid_cross_crate_conflicts = is_generic(substs) || is_globally_shared_function;
- let instantiating_crate =
- if avoid_cross_crate_conflicts { Some(compute_instantiating_crate()) } else { None };
+ let instantiating_crate = avoid_cross_crate_conflicts.then(compute_instantiating_crate);
// Pick the crate responsible for the symbol mangling version, which has to:
// 1. be stable for each instance, whether it's being defined or imported