From ad65e3e6bc8ded92db38507b84ec4a2bf2677d62 Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Fri, 10 Jan 2020 10:32:16 +0100 Subject: [PATCH] Fix some rebasing fallout. --- Cargo.lock | 1 + src/librustc/ty/query/profiling_support.rs | 2 +- src/librustc_codegen_ssa/base.rs | 12 ++---------- src/librustc_data_structures/profiling.rs | 9 ++++++--- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 044e14971a3..bbe014baa49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3079,6 +3079,7 @@ dependencies = [ "graphviz", "jobserver", "log", + "measureme", "parking_lot", "polonius-engine", "rustc-rayon", diff --git a/src/librustc/ty/query/profiling_support.rs b/src/librustc/ty/query/profiling_support.rs index 3a363c3f824..79b32ba83ae 100644 --- a/src/librustc/ty/query/profiling_support.rs +++ b/src/librustc/ty/query/profiling_support.rs @@ -1,4 +1,3 @@ -use crate::hir::def_id::{CrateNum, DefId, DefIndex, CRATE_DEF_INDEX, LOCAL_CRATE}; use crate::hir::map::definitions::DefPathData; use crate::ty::context::TyCtxt; use crate::ty::query::config::QueryConfig; @@ -7,6 +6,7 @@ use measureme::{StringComponent, StringId}; use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::profiling::SelfProfiler; use rustc_data_structures::sharded::Sharded; +use rustc_hir::def_id::{CrateNum, DefId, DefIndex, CRATE_DEF_INDEX, LOCAL_CRATE}; use std::fmt::Debug; use std::io::Write; diff --git a/src/librustc_codegen_ssa/base.rs b/src/librustc_codegen_ssa/base.rs index 857aa9c1bcc..9b9434539a8 100644 --- a/src/librustc_codegen_ssa/base.rs +++ b/src/librustc_codegen_ssa/base.rs @@ -334,11 +334,7 @@ pub fn from_immediate<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>( bx: &mut Bx, val: Bx::Value, ) -> Bx::Value { - if bx.cx().val_ty(val) == bx.cx().type_i1() { - bx.zext(val, bx.cx().type_i8()) - } else { - val - } + if bx.cx().val_ty(val) == bx.cx().type_i1() { bx.zext(val, bx.cx().type_i8()) } else { val } } pub fn to_immediate<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>( @@ -887,11 +883,7 @@ fn determine_cgu_reuse<'tcx>(tcx: TyCtxt<'tcx>, cgu: &CodegenUnit<'tcx>) -> CguR if tcx.dep_graph.try_mark_green(tcx, &dep_node).is_some() { // We can re-use either the pre- or the post-thinlto state - if tcx.sess.lto() != Lto::No { - CguReuse::PreLto - } else { - CguReuse::PostLto - } + if tcx.sess.lto() != Lto::No { CguReuse::PreLto } else { CguReuse::PostLto } } else { CguReuse::No } diff --git a/src/librustc_data_structures/profiling.rs b/src/librustc_data_structures/profiling.rs index 93f8b943224..e8a70d58f0c 100644 --- a/src/librustc_data_structures/profiling.rs +++ b/src/librustc_data_structures/profiling.rs @@ -224,7 +224,10 @@ impl SelfProfilerRef { /// a measureme event, "verbose" generic activities also print a timing entry to /// stdout if the compiler is invoked with -Ztime or -Ztime-passes. #[inline(always)] - pub fn verbose_generic_activity<'a>(&'a self, event_id: &'a str) -> VerboseTimingGuard<'a> { + pub fn verbose_generic_activity<'a>( + &'a self, + event_id: &'static str, + ) -> VerboseTimingGuard<'a> { VerboseTimingGuard::start( event_id, self.print_verbose_generic_activities, @@ -589,8 +592,8 @@ fn get_resident() -> Option { cb: DWORD, ) -> BOOL; } - let mut pmc: PROCESS_MEMORY_COUNTERS = unsafe { mem::zeroed() }; - pmc.cb = mem::size_of_val(&pmc) as DWORD; + let mut pmc: PROCESS_MEMORY_COUNTERS = unsafe { std::mem::zeroed() }; + pmc.cb = std::mem::size_of_val(&pmc) as DWORD; match unsafe { GetProcessMemoryInfo(GetCurrentProcess(), &mut pmc, pmc.cb) } { 0 => None, _ => Some(pmc.WorkingSetSize as usize),