about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/bin
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2022-03-20 16:55:21 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2022-03-20 16:55:21 +0100
commitef4ce72919d1a16ad5aed4108d5abcf4d5c2cdc8 (patch)
tree5e6b18b3d26ff3fdf8ed1347edd8eb3b8a234a38 /compiler/rustc_codegen_cranelift/src/bin
parentc7ce69faf2a7ea16c15d922985ca27ba70da30ee (diff)
parent370c397ec9169809e5ad270079712e0043514240 (diff)
downloadrust-ef4ce72919d1a16ad5aed4108d5abcf4d5c2cdc8.tar.gz
rust-ef4ce72919d1a16ad5aed4108d5abcf4d5c2cdc8.zip
Merge commit '370c397ec9169809e5ad270079712e0043514240' into sync_cg_clif-2022-03-20
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/bin')
-rw-r--r--compiler/rustc_codegen_cranelift/src/bin/cg_clif.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/bin/cg_clif.rs b/compiler/rustc_codegen_cranelift/src/bin/cg_clif.rs
index b924f2085a0..5984ec8412a 100644
--- a/compiler/rustc_codegen_cranelift/src/bin/cg_clif.rs
+++ b/compiler/rustc_codegen_cranelift/src/bin/cg_clif.rs
@@ -1,4 +1,4 @@
-#![feature(rustc_private, once_cell)]
+#![feature(rustc_private)]
 #![warn(rust_2018_idioms)]
 #![warn(unused_lifetimes)]
 #![warn(unreachable_pub)]
@@ -9,19 +9,21 @@ extern crate rustc_interface;
 extern crate rustc_session;
 extern crate rustc_target;
 
-use std::lazy::SyncLazy;
 use std::panic;
 
 use rustc_data_structures::profiling::{get_resident_set_size, print_time_passes_entry};
 use rustc_interface::interface;
-use rustc_session::config::ErrorOutputType;
+use rustc_session::config::{ErrorOutputType, TrimmedDefPaths};
 use rustc_session::early_error;
 use rustc_target::spec::PanicStrategy;
 
+// FIXME use std::lazy::SyncLazy once it stabilizes
+use once_cell::sync::Lazy;
+
 const BUG_REPORT_URL: &str = "https://github.com/bjorn3/rustc_codegen_cranelift/issues/new";
 
-static DEFAULT_HOOK: SyncLazy<Box<dyn Fn(&panic::PanicInfo<'_>) + Sync + Send + 'static>> =
-    SyncLazy::new(|| {
+static DEFAULT_HOOK: Lazy<Box<dyn Fn(&panic::PanicInfo<'_>) + Sync + Send + 'static>> =
+    Lazy::new(|| {
         let hook = panic::take_hook();
         panic::set_hook(Box::new(|info| {
             // Invoke the default handler, which prints the actual panic message and optionally a backtrace
@@ -53,6 +55,8 @@ impl rustc_driver::Callbacks for CraneliftPassesCallbacks {
         config.opts.maybe_sysroot = Some(config.opts.maybe_sysroot.clone().unwrap_or_else(|| {
             std::env::current_exe().unwrap().parent().unwrap().parent().unwrap().to_owned()
         }));
+
+        config.opts.trimmed_def_paths = TrimmedDefPaths::GoodPath;
     }
 }
 
@@ -61,7 +65,7 @@ fn main() {
     let start_rss = get_resident_set_size();
     rustc_driver::init_rustc_env_logger();
     let mut callbacks = CraneliftPassesCallbacks::default();
-    SyncLazy::force(&DEFAULT_HOOK); // Install ice hook
+    Lazy::force(&DEFAULT_HOOK); // Install ice hook
     let exit_code = rustc_driver::catch_with_exit_code(|| {
         let args = std::env::args_os()
             .enumerate()