1
- #![ feature( rustc_private, once_cell ) ]
1
+ #![ feature( rustc_private) ]
2
2
#![ warn( rust_2018_idioms) ]
3
3
#![ warn( unused_lifetimes) ]
4
4
#![ warn( unreachable_pub) ]
@@ -9,7 +9,6 @@ extern crate rustc_interface;
9
9
extern crate rustc_session;
10
10
extern crate rustc_target;
11
11
12
- use std:: lazy:: SyncLazy ;
13
12
use std:: panic;
14
13
15
14
use rustc_data_structures:: profiling:: { get_resident_set_size, print_time_passes_entry} ;
@@ -18,10 +17,13 @@ use rustc_session::config::ErrorOutputType;
18
17
use rustc_session:: early_error;
19
18
use rustc_target:: spec:: PanicStrategy ;
20
19
20
+ // FIXME use std::lazy::SyncLazy once it stabilizes
21
+ use once_cell:: sync:: Lazy ;
22
+
21
23
const BUG_REPORT_URL : & str = "https://github.com/bjorn3/rustc_codegen_cranelift/issues/new" ;
22
24
23
- static DEFAULT_HOOK : SyncLazy < Box < dyn Fn ( & panic:: PanicInfo < ' _ > ) + Sync + Send + ' static > > =
24
- SyncLazy :: new ( || {
25
+ static DEFAULT_HOOK : Lazy < Box < dyn Fn ( & panic:: PanicInfo < ' _ > ) + Sync + Send + ' static > > =
26
+ Lazy :: new ( || {
25
27
let hook = panic:: take_hook ( ) ;
26
28
panic:: set_hook ( Box :: new ( |info| {
27
29
// Invoke the default handler, which prints the actual panic message and optionally a backtrace
@@ -61,7 +63,7 @@ fn main() {
61
63
let start_rss = get_resident_set_size ( ) ;
62
64
rustc_driver:: init_rustc_env_logger ( ) ;
63
65
let mut callbacks = CraneliftPassesCallbacks :: default ( ) ;
64
- SyncLazy :: force ( & DEFAULT_HOOK ) ; // Install ice hook
66
+ Lazy :: force ( & DEFAULT_HOOK ) ; // Install ice hook
65
67
let exit_code = rustc_driver:: catch_with_exit_code ( || {
66
68
let args = std:: env:: args_os ( )
67
69
. enumerate ( )
0 commit comments