Skip to content

Commit 34fe28b

Browse files
committed
Fix tidy
1 parent 4d62545 commit 34fe28b

File tree

10 files changed

+39
-15
lines changed

10 files changed

+39
-15
lines changed

src/librustc/query/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ rustc_queries! {
110110
no_hash
111111
}
112112

113-
query mir_validated(_: DefId) -> (&'tcx Steal<mir::Body<'tcx>>, &'tcx Steal<IndexVec<mir::Promoted, mir::Body<'tcx>>>) {
113+
query mir_validated(_: DefId) ->
114+
(
115+
&'tcx Steal<mir::Body<'tcx>>,
116+
&'tcx Steal<IndexVec<mir::Promoted, mir::Body<'tcx>>>
117+
) {
114118
no_hash
115119
}
116120

src/librustc_codegen_ssa/mir/place.rs

-1
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
460460
}),
461461
projection: None,
462462
} => {
463-
debug!("promoted={:?}, def_id={:?}, substs={:?}, self_substs={:?}", promoted, def_id, substs, self.instance.substs);
464463
let param_env = ty::ParamEnv::reveal_all();
465464
let instance = Instance::new(*def_id, substs.subst(bx.tcx(), self.instance.substs));
466465
debug!("instance: {:?}", instance);

src/librustc_metadata/decoder.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,8 @@ impl<'a, 'tcx> CrateMetadata {
924924
}
925925
}
926926

927-
pub fn maybe_get_promoted_mir(&self, tcx: TyCtxt<'tcx>, id: DefIndex) -> Option<IndexVec<Promoted, Body<'tcx>>> {
927+
pub fn maybe_get_promoted_mir(&self, tcx: TyCtxt<'tcx>, id: DefIndex) ->
928+
Option<IndexVec<Promoted, Body<'tcx>>> {
928929
match self.is_proc_macro(id) {
929930
true => None,
930931
false => self.entry(id).promoted_mir.map(|promoted| promoted.decode((self, tcx)),)

src/librustc_metadata/encoder.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,8 @@ impl EncodeContext<'tcx> {
10601060
}
10611061
}
10621062

1063-
fn encode_promoted_mir(&mut self, def_id: DefId) -> Option<Lazy<IndexVec<mir::Promoted, mir::Body<'tcx>>>> {
1063+
fn encode_promoted_mir(&mut self, def_id: DefId) ->
1064+
Option<Lazy<IndexVec<mir::Promoted, mir::Body<'tcx>>>> {
10641065
debug!("EncodeContext::encode_promoted_mir({:?})", def_id);
10651066
if self.tcx.mir_keys(LOCAL_CRATE).contains(&def_id) {
10661067
let promoted = self.tcx.promoted_mir(def_id);

src/librustc_mir/borrow_check/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ fn do_mir_borrowck<'a, 'tcx>(
151151
// will have a lifetime tied to the inference context.
152152
let mut body: Body<'tcx> = input_body.clone();
153153
let mut promoted: IndexVec<Promoted, Body<'tcx>> = input_promoted.clone();
154-
let free_regions = nll::replace_regions_in_mir(infcx, def_id, param_env, &mut body, &mut promoted);
154+
let free_regions =
155+
nll::replace_regions_in_mir(infcx, def_id, param_env, &mut body, &mut promoted);
155156
let body = &body; // no further changes
156157
let location_table = &LocationTable::new(body);
157158

src/librustc_mir/borrow_check/nll/renumber.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ use rustc_data_structures::indexed_vec::IndexVec;
77

88
/// Replaces all free regions appearing in the MIR with fresh
99
/// inference variables, returning the number of variables created.
10-
pub fn renumber_mir<'tcx>(infcx: &InferCtxt<'_, 'tcx>, body: &mut Body<'tcx>, promoted: &mut IndexVec<Promoted, Body<'tcx>>) {
10+
pub fn renumber_mir<'tcx>(
11+
infcx: &InferCtxt<'_, 'tcx>,
12+
body: &mut Body<'tcx>,
13+
promoted: &mut IndexVec<Promoted, Body<'tcx>>,
14+
) {
1115
debug!("renumber_mir()");
1216
debug!("renumber_mir: body.arg_count={:?}", body.arg_count);
1317

src/librustc_mir/borrow_check/nll/type_check/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,11 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
384384
}
385385

386386
impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
387-
fn new(cx: &'a mut TypeChecker<'b, 'tcx>, body: &'b Body<'tcx>, promoted: &'b IndexVec<Promoted, Body<'tcx>>) -> Self {
387+
fn new(
388+
cx: &'a mut TypeChecker<'b, 'tcx>,
389+
body: &'b Body<'tcx>,
390+
promoted: &'b IndexVec<Promoted, Body<'tcx>>,
391+
) -> Self {
388392
TypeVerifier {
389393
body,
390394
promoted,

src/librustc_mir/monomorphize/collector.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -670,15 +670,16 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> {
670670
self.output.push(MonoItem::Static(*def_id));
671671
}
672672
}
673-
PlaceBase::Static(box Static { kind: StaticKind::Promoted(promoted, substs), def_id, .. }) => {
674-
debug!("collecting promoted(def_id: {:?}, promoted: {:?}, substs: {:?})", def_id, promoted, substs);
675-
debug!("param_substs: {:?}", self.param_substs);
673+
PlaceBase::Static(box Static {
674+
kind: StaticKind::Promoted(promoted, substs),
675+
def_id,
676+
..
677+
}) => {
676678
let param_env = ty::ParamEnv::reveal_all();
677679
let cid = GlobalId {
678680
instance: Instance::new(*def_id, substs.subst(self.tcx, self.param_substs)),
679681
promoted: Some(*promoted),
680682
};
681-
debug!("cid: {:?}", cid);
682683
match self.tcx.const_eval(param_env.and(cid)) {
683684
Ok(val) => collect_const(self.tcx, val, substs, self.output),
684685
Err(ErrorHandled::Reported) => {},

src/librustc_mir/transform/mod.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,10 @@ fn mir_const(tcx: TyCtxt<'_>, def_id: DefId) -> &Steal<Body<'_>> {
200200
tcx.alloc_steal_mir(body)
201201
}
202202

203-
fn mir_validated(tcx: TyCtxt<'tcx>, def_id: DefId) -> (&'tcx Steal<Body<'tcx>>, &'tcx Steal<IndexVec<Promoted, Body<'tcx>>>) {
203+
fn mir_validated(
204+
tcx: TyCtxt<'tcx>,
205+
def_id: DefId,
206+
) -> (&'tcx Steal<Body<'tcx>>, &'tcx Steal<IndexVec<Promoted, Body<'tcx>>>) {
204207
let hir_id = tcx.hir().as_local_hir_id(def_id).unwrap();
205208
if let hir::BodyOwnerKind::Const = tcx.hir().body_owner_kind(hir_id) {
206209
// Ensure that we compute the `mir_const_qualif` for constants at
@@ -215,8 +218,9 @@ fn mir_validated(tcx: TyCtxt<'tcx>, def_id: DefId) -> (&'tcx Steal<Body<'tcx>>,
215218
&qualify_and_promote_pass,
216219
&simplify::SimplifyCfg::new("qualify-consts"),
217220
]);
218-
let promoted = qualify_and_promote_pass.promoted.into_inner();
219-
(tcx.alloc_steal_mir(body), tcx.alloc_steal_promoted(promoted.unwrap_or_else(|| IndexVec::new())))
221+
let promoted =
222+
qualify_and_promote_pass.promoted.into_inner().unwrap_or_else(|| IndexVec::new());
223+
(tcx.alloc_steal_mir(body), tcx.alloc_steal_promoted(promoted))
220224
}
221225

222226
fn optimized_mir(tcx: TyCtxt<'_>, def_id: DefId) -> &Body<'_> {

src/librustc_mir/transform/promote_consts.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,12 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> {
295295
new_temp
296296
}
297297

298-
fn promote_candidate(mut self, def_id: DefId, candidate: Candidate, next_promoted_id: usize) -> Option<Body<'tcx>> {
298+
fn promote_candidate(
299+
mut self,
300+
def_id: DefId,
301+
candidate: Candidate,
302+
next_promoted_id: usize,
303+
) -> Option<Body<'tcx>> {
299304
let mut operand = {
300305
let promoted = &mut self.promoted;
301306
let promoted_id = Promoted::new(next_promoted_id);

0 commit comments

Comments
 (0)