diff --git a/src/base.rs b/src/base.rs index 08c9d09b1f8e..b460547e8209 100644 --- a/src/base.rs +++ b/src/base.rs @@ -9,7 +9,10 @@ impl Drop for PrintOnPanic { } } -pub fn trans_mono_item<'a, 'tcx: 'a>(cx: &mut CodegenCx<'a, 'tcx, impl Backend>, mono_item: MonoItem<'tcx>) { +pub fn trans_mono_item<'a, 'tcx: 'a>( + cx: &mut CodegenCx<'a, 'tcx, impl Backend>, + mono_item: MonoItem<'tcx>, +) { let tcx = cx.tcx; let context = &mut cx.context; diff --git a/src/lib.rs b/src/lib.rs index bcf76d165745..88a3498885f2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -68,7 +68,11 @@ mod prelude { self, subst::Substs, FnSig, Instance, InstanceDef, ParamEnv, PolyFnSig, Ty, TyCtxt, TypeAndMut, TypeFoldable, TypeVariants, }; - pub use rustc_data_structures::{fx::{FxHashSet, FxHashMap}, indexed_vec::Idx, sync::Lrc}; + pub use rustc_data_structures::{ + fx::{FxHashMap, FxHashSet}, + indexed_vec::Idx, + sync::Lrc, + }; pub use rustc_mir::monomorphize::{collector, MonoItem}; pub use syntax::ast::{FloatTy, IntTy, UintTy}; pub use syntax::codemap::DUMMY_SP; @@ -215,9 +219,8 @@ impl CodegenBackend for CraneliftCodegenBackend { .finish(flags); let mono_items = - collector::collect_crate_mono_items(tcx, collector::MonoItemCollectionMode::Eager) - .0; - + collector::collect_crate_mono_items(tcx, collector::MonoItemCollectionMode::Eager).0; + // TODO: move to the end of this function when compiling libcore doesn't have unimplemented stuff anymore save_incremental(tcx); tcx.sess.warn("Saved incremental data"); @@ -252,13 +255,14 @@ impl CodegenBackend for CraneliftCodegenBackend { ::std::process::exit(0); } else { let mut faerie_module: Module = Module::new( - FaerieBuilder::new( - isa, - "some_file.o".to_string(), - FaerieTrapCollection::Disabled, - FaerieBuilder::default_libcall_names(), - ).unwrap()); - + FaerieBuilder::new( + isa, + "some_file.o".to_string(), + FaerieTrapCollection::Disabled, + FaerieBuilder::default_libcall_names(), + ).unwrap(), + ); + codegen_mono_items(tcx, &mut faerie_module, &mono_items); tcx.sess.abort_if_errors(); @@ -340,7 +344,11 @@ impl CodegenBackend for CraneliftCodegenBackend { } } -fn codegen_mono_items<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>, module: &mut Module, mono_items: &FxHashSet>) { +fn codegen_mono_items<'a, 'tcx: 'a>( + tcx: TyCtxt<'a, 'tcx, 'tcx>, + module: &mut Module, + mono_items: &FxHashSet>, +) { use std::io::Write; let mut cx = CodegenCx {