Run rustfmt --file-lines ... for changes from previous commits.

This commit is contained in:
Eduard-Mihai Burtescu 2019-06-12 00:11:55 +03:00
parent 21ac960334
commit fff08cb043
176 changed files with 2212 additions and 2132 deletions

View file

@ -46,10 +46,10 @@ pub fn crates_export_threshold(crate_types: &[config::CrateType]) -> SymbolExpor
}
}
fn reachable_non_generics_provider<'tcx>(tcx: TyCtxt<'tcx, 'tcx>,
cnum: CrateNum)
-> &'tcx DefIdMap<SymbolExportLevel>
{
fn reachable_non_generics_provider<'tcx>(
tcx: TyCtxt<'tcx, 'tcx>,
cnum: CrateNum,
) -> &'tcx DefIdMap<SymbolExportLevel> {
assert_eq!(cnum, LOCAL_CRATE);
if !tcx.sess.opts.output_types.should_codegen() {
@ -157,9 +157,7 @@ fn reachable_non_generics_provider<'tcx>(tcx: TyCtxt<'tcx, 'tcx>,
tcx.arena.alloc(reachable_non_generics)
}
fn is_reachable_non_generic_provider_local<'tcx>(tcx: TyCtxt<'tcx, 'tcx>,
def_id: DefId)
-> bool {
fn is_reachable_non_generic_provider_local<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, def_id: DefId) -> bool {
let export_threshold = threshold(tcx);
if let Some(&level) = tcx.reachable_non_generics(def_id.krate).get(&def_id) {
@ -169,17 +167,14 @@ fn is_reachable_non_generic_provider_local<'tcx>(tcx: TyCtxt<'tcx, 'tcx>,
}
}
fn is_reachable_non_generic_provider_extern<'tcx>(tcx: TyCtxt<'tcx, 'tcx>,
def_id: DefId)
-> bool {
fn is_reachable_non_generic_provider_extern<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, def_id: DefId) -> bool {
tcx.reachable_non_generics(def_id.krate).contains_key(&def_id)
}
fn exported_symbols_provider_local<'tcx>(tcx: TyCtxt<'tcx, 'tcx>,
cnum: CrateNum)
-> Arc<Vec<(ExportedSymbol<'tcx>,
SymbolExportLevel)>>
{
fn exported_symbols_provider_local<'tcx>(
tcx: TyCtxt<'tcx, 'tcx>,
cnum: CrateNum,
) -> Arc<Vec<(ExportedSymbol<'tcx>, SymbolExportLevel)>> {
assert_eq!(cnum, LOCAL_CRATE);
if !tcx.sess.opts.output_types.should_codegen() {
@ -280,9 +275,8 @@ fn exported_symbols_provider_local<'tcx>(tcx: TyCtxt<'tcx, 'tcx>,
fn upstream_monomorphizations_provider<'tcx>(
tcx: TyCtxt<'tcx, 'tcx>,
cnum: CrateNum)
-> &'tcx DefIdMap<FxHashMap<SubstsRef<'tcx>, CrateNum>>
{
cnum: CrateNum,
) -> &'tcx DefIdMap<FxHashMap<SubstsRef<'tcx>, CrateNum>> {
debug_assert!(cnum == LOCAL_CRATE);
let cnums = tcx.all_crate_nums(LOCAL_CRATE);
@ -330,9 +324,8 @@ fn upstream_monomorphizations_provider<'tcx>(
fn upstream_monomorphizations_for_provider<'tcx>(
tcx: TyCtxt<'tcx, 'tcx>,
def_id: DefId)
-> Option<&'tcx FxHashMap<SubstsRef<'tcx>, CrateNum>>
{
def_id: DefId,
) -> Option<&'tcx FxHashMap<SubstsRef<'tcx>, CrateNum>> {
debug_assert!(!def_id.is_local());
tcx.upstream_monomorphizations(LOCAL_CRATE).get(&def_id)
}

View file

@ -378,7 +378,7 @@ pub fn start_async_codegen<B: ExtraBackendMethods>(
tcx: TyCtxt<'_, '_>,
metadata: EncodedMetadata,
coordinator_receive: Receiver<Box<dyn Any + Send>>,
total_cgus: usize
total_cgus: usize,
) -> OngoingCodegen<B> {
let sess = tcx.sess;
let crate_name = tcx.crate_name(LOCAL_CRATE);
@ -1005,7 +1005,7 @@ fn start_executing_work<B: ExtraBackendMethods>(
jobserver: Client,
modules_config: Arc<ModuleConfig>,
metadata_config: Arc<ModuleConfig>,
allocator_config: Arc<ModuleConfig>
allocator_config: Arc<ModuleConfig>,
) -> thread::JoinHandle<Result<CompiledModules, ()>> {
let coordinator_send = tcx.tx_to_llvm_workers.lock().clone();
let sess = tcx.sess;
@ -1861,9 +1861,11 @@ impl<B: ExtraBackendMethods> OngoingCodegen<B> {
}, work_products)
}
pub fn submit_pre_codegened_module_to_llvm(&self,
tcx: TyCtxt<'_, '_>,
module: ModuleCodegen<B::Module>) {
pub fn submit_pre_codegened_module_to_llvm(
&self,
tcx: TyCtxt<'_, '_>,
module: ModuleCodegen<B::Module>,
) {
self.wait_for_signal_to_codegen_item();
self.check_for_errors(tcx.sess);
@ -1913,7 +1915,7 @@ pub fn submit_codegened_module_to_llvm<B: ExtraBackendMethods>(
_backend: &B,
tcx: TyCtxt<'_, '_>,
module: ModuleCodegen<B::Module>,
cost: u64
cost: u64,
) {
let llvm_work_item = WorkItem::Optimize(module);
drop(tcx.tx_to_llvm_workers.lock().send(Box::new(Message::CodegenDone::<B> {
@ -1925,7 +1927,7 @@ pub fn submit_codegened_module_to_llvm<B: ExtraBackendMethods>(
pub fn submit_post_lto_module_to_llvm<B: ExtraBackendMethods>(
_backend: &B,
tcx: TyCtxt<'_, '_>,
module: CachedModuleCodegen
module: CachedModuleCodegen,
) {
let llvm_work_item = WorkItem::CopyPostLtoArtifacts(module);
drop(tcx.tx_to_llvm_workers.lock().send(Box::new(Message::CodegenDone::<B> {
@ -1937,7 +1939,7 @@ pub fn submit_post_lto_module_to_llvm<B: ExtraBackendMethods>(
pub fn submit_pre_lto_module_to_llvm<B: ExtraBackendMethods>(
_backend: &B,
tcx: TyCtxt<'_, '_>,
module: CachedModuleCodegen
module: CachedModuleCodegen,
) {
let filename = pre_lto_bitcode_filename(&module.name);
let bc_path = in_incr_comp_dir_sess(tcx.sess, &filename);