Skip to content

Commit ea78c3a

Browse files
committed
Run rustfmt --file-lines ... for changes from previous commits.
1 parent 4c4fc75 commit ea78c3a

File tree

13 files changed

+103
-77
lines changed

13 files changed

+103
-77
lines changed

src/librustc/ty/query/on_disk_cache.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -505,12 +505,11 @@ impl<'a, 'tcx> DecoderWithPosition for CacheDecoder<'a, 'tcx> {
505505

506506
// Decode something that was encoded with encode_tagged() and verify that the
507507
// tag matches and the correct amount of bytes was read.
508-
fn decode_tagged<D, T, V>(decoder: &mut D,
509-
expected_tag: T)
510-
-> Result<V, D::Error>
511-
where T: Decodable + Eq + ::std::fmt::Debug,
512-
V: Decodable,
513-
D: DecoderWithPosition,
508+
fn decode_tagged<D, T, V>(decoder: &mut D, expected_tag: T) -> Result<V, D::Error>
509+
where
510+
T: Decodable + Eq + ::std::fmt::Debug,
511+
V: Decodable,
512+
D: DecoderWithPosition,
514513
{
515514
let start_pos = decoder.position();
516515

src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs

+14-10
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct GatherMoveInfo<'c, 'tcx> {
2020
id: hir::ItemLocalId,
2121
kind: MoveKind,
2222
cmt: &'c mc::cmt_<'tcx>,
23-
span_path_opt: Option<MovePlace<'tcx>>
23+
span_path_opt: Option<MovePlace<'tcx>>,
2424
}
2525

2626
/// Represents the kind of pattern
@@ -91,11 +91,13 @@ pub fn gather_move_from_expr<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
9191
gather_move(bccx, move_data, move_error_collector, move_info);
9292
}
9393

94-
pub fn gather_move_from_pat<'a, 'c, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
95-
move_data: &MoveData<'tcx>,
96-
move_error_collector: &mut MoveErrorCollector<'tcx>,
97-
move_pat: &hir::Pat,
98-
cmt: &'c mc::cmt_<'tcx>) {
94+
pub fn gather_move_from_pat<'a, 'c, 'tcx>(
95+
bccx: &BorrowckCtxt<'a, 'tcx>,
96+
move_data: &MoveData<'tcx>,
97+
move_error_collector: &mut MoveErrorCollector<'tcx>,
98+
move_pat: &hir::Pat,
99+
cmt: &'c mc::cmt_<'tcx>,
100+
) {
99101
let source = get_pattern_source(bccx.tcx,move_pat);
100102
let pat_span_path_opt = match move_pat.node {
101103
PatKind::Binding(_, _, ident, _) => {
@@ -121,10 +123,12 @@ pub fn gather_move_from_pat<'a, 'c, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
121123
gather_move(bccx, move_data, move_error_collector, move_info);
122124
}
123125

124-
fn gather_move<'a, 'c, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
125-
move_data: &MoveData<'tcx>,
126-
move_error_collector: &mut MoveErrorCollector<'tcx>,
127-
move_info: GatherMoveInfo<'c, 'tcx>) {
126+
fn gather_move<'a, 'c, 'tcx>(
127+
bccx: &BorrowckCtxt<'a, 'tcx>,
128+
move_data: &MoveData<'tcx>,
129+
move_error_collector: &mut MoveErrorCollector<'tcx>,
130+
move_info: GatherMoveInfo<'c, 'tcx>,
131+
) {
128132
debug!("gather_move(move_id={:?}, cmt={:?})",
129133
move_info.id, move_info.cmt);
130134

src/librustc_codegen_ssa/base.rs

+7-9
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub fn compare_simd_types<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
9494
rhs: Bx::Value,
9595
t: Ty<'tcx>,
9696
ret_ty: Bx::Type,
97-
op: hir::BinOpKind
97+
op: hir::BinOpKind,
9898
) -> Bx::Value {
9999
let signed = match t.sty {
100100
ty::Float(_) => {
@@ -156,7 +156,7 @@ pub fn unsize_thin_ptr<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
156156
bx: &mut Bx,
157157
src: Bx::Value,
158158
src_ty: Ty<'tcx>,
159-
dst_ty: Ty<'tcx>
159+
dst_ty: Ty<'tcx>,
160160
) -> (Bx::Value, Bx::Value) {
161161
debug!("unsize_thin_ptr: {:?} => {:?}", src_ty, dst_ty);
162162
match (&src_ty.sty, &dst_ty.sty) {
@@ -210,8 +210,8 @@ pub fn unsize_thin_ptr<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
210210
pub fn coerce_unsized_into<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
211211
bx: &mut Bx,
212212
src: PlaceRef<'tcx, Bx::Value>,
213-
dst: PlaceRef<'tcx, Bx::Value>
214-
) {
213+
dst: PlaceRef<'tcx, Bx::Value>,
214+
) {
215215
let src_ty = src.layout.ty;
216216
let dst_ty = dst.layout.ty;
217217
let mut coerce_ptr = || {
@@ -270,7 +270,7 @@ pub fn cast_shift_expr_rhs<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
270270
bx: &mut Bx,
271271
op: hir::BinOpKind,
272272
lhs: Bx::Value,
273-
rhs: Bx::Value
273+
rhs: Bx::Value,
274274
) -> Bx::Value {
275275
cast_shift_rhs(bx, op, lhs, rhs)
276276
}
@@ -318,7 +318,7 @@ pub fn wants_msvc_seh(sess: &Session) -> bool {
318318

319319
pub fn from_immediate<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
320320
bx: &mut Bx,
321-
val: Bx::Value
321+
val: Bx::Value,
322322
) -> Bx::Value {
323323
if bx.cx().val_ty(val) == bx.cx().type_i1() {
324324
bx.zext(val, bx.cx().type_i8())
@@ -387,9 +387,7 @@ pub fn codegen_instance<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
387387

388388
/// Creates the `main` function which will initialize the rust runtime and call
389389
/// users main function.
390-
pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
391-
cx: &'a Bx::CodegenCx
392-
) {
390+
pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(cx: &'a Bx::CodegenCx) {
393391
let (main_def_id, span) = match cx.tcx().entry_fn(LOCAL_CRATE) {
394392
Some((def_id, _)) => { (def_id, cx.tcx().def_span(def_id)) },
395393
None => return,

src/librustc_codegen_ssa/common.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ pub fn langcall(tcx: TyCtxt<'_>, span: Option<Span>, msg: &str, li: LangItem) ->
140140
pub fn build_unchecked_lshift<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
141141
bx: &mut Bx,
142142
lhs: Bx::Value,
143-
rhs: Bx::Value
143+
rhs: Bx::Value,
144144
) -> Bx::Value {
145145
let rhs = base::cast_shift_expr_rhs(bx, hir::BinOpKind::Shl, lhs, rhs);
146146
// #1877, #10183: Ensure that input is always valid
@@ -152,7 +152,7 @@ pub fn build_unchecked_rshift<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
152152
bx: &mut Bx,
153153
lhs_t: Ty<'tcx>,
154154
lhs: Bx::Value,
155-
rhs: Bx::Value
155+
rhs: Bx::Value,
156156
) -> Bx::Value {
157157
let rhs = base::cast_shift_expr_rhs(bx, hir::BinOpKind::Shr, lhs, rhs);
158158
// #1877, #10183: Ensure that input is always valid
@@ -167,7 +167,7 @@ pub fn build_unchecked_rshift<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
167167

168168
fn shift_mask_rhs<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
169169
bx: &mut Bx,
170-
rhs: Bx::Value
170+
rhs: Bx::Value,
171171
) -> Bx::Value {
172172
let rhs_llty = bx.val_ty(rhs);
173173
let shift_val = shift_mask_val(bx, rhs_llty, rhs_llty, false);
@@ -178,7 +178,7 @@ pub fn shift_mask_val<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
178178
bx: &mut Bx,
179179
llty: Bx::Type,
180180
mask_llty: Bx::Type,
181-
invert: bool
181+
invert: bool,
182182
) -> Bx::Value {
183183
let kind = bx.type_kind(llty);
184184
match kind {

src/librustc_codegen_ssa/glue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::traits::*;
1010
pub fn size_and_align_of_dst<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
1111
bx: &mut Bx,
1212
t: Ty<'tcx>,
13-
info: Option<Bx::Value>
13+
info: Option<Bx::Value>,
1414
) -> (Bx::Value, Bx::Value) {
1515
let layout = bx.layout_of(t);
1616
debug!("size_and_align_of_dst(ty={}, info={:?}): layout: {:?}",

src/librustc_codegen_ssa/mir/analyze.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use super::FunctionCx;
1313
use crate::traits::*;
1414

1515
pub fn non_ssa_locals<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
16-
fx: &FunctionCx<'a, 'tcx, Bx>
16+
fx: &FunctionCx<'a, 'tcx, Bx>,
1717
) -> BitSet<mir::Local> {
1818
let mir = fx.mir;
1919
let mut analyzer = LocalAnalyzer::new(fx);
@@ -49,7 +49,7 @@ struct LocalAnalyzer<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> {
4949
non_ssa_locals: BitSet<mir::Local>,
5050
// The location of the first visited direct assignment to each
5151
// local, or an invalid location (out of bounds `block` index).
52-
first_assignment: IndexVec<mir::Local, Location>
52+
first_assignment: IndexVec<mir::Local, Location>,
5353
}
5454

5555
impl<Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, Bx> {
@@ -95,7 +95,8 @@ impl<Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, Bx> {
9595
}
9696

9797
impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
98-
for LocalAnalyzer<'mir, 'a, 'tcx, Bx> {
98+
for LocalAnalyzer<'mir, 'a, 'tcx, Bx>
99+
{
99100
fn visit_assign(&mut self,
100101
place: &mir::Place<'tcx>,
101102
rvalue: &mir::Rvalue<'tcx>,

src/librustc_codegen_ssa/mir/mod.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub struct FunctionCx<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> {
4343
/// don't really care about it very much. Anyway, this value
4444
/// contains an alloca into which the personality is stored and
4545
/// then later loaded when generating the DIVERGE_BLOCK.
46-
personality_slot: Option<PlaceRef<'tcx, Bx::Value,>>,
46+
personality_slot: Option<PlaceRef<'tcx, Bx::Value>>,
4747

4848
/// A `Block` for each MIR `BasicBlock`
4949
blocks: IndexVec<mir::BasicBlock, Bx::BasicBlock>,
@@ -355,10 +355,11 @@ fn create_funclets<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
355355
mir: &'a Body<'tcx>,
356356
bx: &mut Bx,
357357
cleanup_kinds: &IndexVec<mir::BasicBlock, CleanupKind>,
358-
block_bxs: &IndexVec<mir::BasicBlock, Bx::BasicBlock>)
359-
-> (IndexVec<mir::BasicBlock, Option<Bx::BasicBlock>>,
360-
IndexVec<mir::BasicBlock, Option<Bx::Funclet>>)
361-
{
358+
block_bxs: &IndexVec<mir::BasicBlock, Bx::BasicBlock>,
359+
) -> (
360+
IndexVec<mir::BasicBlock, Option<Bx::BasicBlock>>,
361+
IndexVec<mir::BasicBlock, Option<Bx::Funclet>>,
362+
) {
362363
block_bxs.iter_enumerated().zip(cleanup_kinds).map(|((bb, &llbb), cleanup_kind)| {
363364
match *cleanup_kind {
364365
CleanupKind::Funclet if base::wants_msvc_seh(bx.sess()) => {}

src/librustc_mir/dataflow/mod.rs

+24-9
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub(crate) mod indexes {
4343

4444
pub(crate) struct DataflowBuilder<'a, 'tcx, BD>
4545
where
46-
BD: BitDenotation<'tcx>
46+
BD: BitDenotation<'tcx>,
4747
{
4848
def_id: DefId,
4949
flow_state: DataflowAnalysis<'a, 'tcx, BD>,
@@ -88,7 +88,7 @@ pub(crate) trait Dataflow<'tcx, BD: BitDenotation<'tcx>> {
8888

8989
impl<'a, 'tcx, BD> Dataflow<'tcx, BD> for DataflowBuilder<'a, 'tcx, BD>
9090
where
91-
BD: BitDenotation<'tcx>
91+
BD: BitDenotation<'tcx>,
9292
{
9393
fn dataflow<P>(&mut self, p: P) where P: Fn(&BD, BD::Idx) -> DebugFormatted {
9494
self.flow_state.build_sets();
@@ -179,12 +179,16 @@ where
179179
}
180180
}
181181

182-
struct PropagationContext<'b, 'a, 'tcx, O> where O: 'b + BitDenotation<'tcx>
182+
struct PropagationContext<'b, 'a, 'tcx, O>
183+
where
184+
O: 'b + BitDenotation<'tcx>,
183185
{
184186
builder: &'b mut DataflowAnalysis<'a, 'tcx, O>,
185187
}
186188

187-
impl<'a, 'tcx, BD> DataflowAnalysis<'a, 'tcx, BD> where BD: BitDenotation<'tcx>
189+
impl<'a, 'tcx, BD> DataflowAnalysis<'a, 'tcx, BD>
190+
where
191+
BD: BitDenotation<'tcx>,
188192
{
189193
fn propagate(&mut self) {
190194
let mut temp = BitSet::new_empty(self.flow_state.sets.bits_per_block);
@@ -234,7 +238,9 @@ impl<'a, 'tcx, BD> DataflowAnalysis<'a, 'tcx, BD> where BD: BitDenotation<'tcx>
234238
}
235239
}
236240

237-
impl<'b, 'a, 'tcx, BD> PropagationContext<'b, 'a, 'tcx, BD> where BD: BitDenotation<'tcx>
241+
impl<'b, 'a, 'tcx, BD> PropagationContext<'b, 'a, 'tcx, BD>
242+
where
243+
BD: BitDenotation<'tcx>,
238244
{
239245
fn walk_cfg(&mut self, in_out: &mut BitSet<BD::Idx>) {
240246
let mut dirty_queue: WorkQueue<mir::BasicBlock> =
@@ -265,7 +271,9 @@ fn dataflow_path(context: &str, path: &str) -> PathBuf {
265271
path
266272
}
267273

268-
impl<'a, 'tcx, BD> DataflowBuilder<'a, 'tcx, BD> where BD: BitDenotation<'tcx>
274+
impl<'a, 'tcx, BD> DataflowBuilder<'a, 'tcx, BD>
275+
where
276+
BD: BitDenotation<'tcx>,
269277
{
270278
fn pre_dataflow_instrumentation<P>(&self, p: P) -> io::Result<()>
271279
where P: Fn(&BD, BD::Idx) -> DebugFormatted
@@ -387,14 +395,18 @@ pub fn state_for_location<'tcx, T: BitDenotation<'tcx>>(loc: Location,
387395
gen_set.to_dense()
388396
}
389397

390-
pub struct DataflowAnalysis<'a, 'tcx, O> where O: BitDenotation<'tcx>
398+
pub struct DataflowAnalysis<'a, 'tcx, O>
399+
where
400+
O: BitDenotation<'tcx>,
391401
{
392402
flow_state: DataflowState<'tcx, O>,
393403
dead_unwinds: &'a BitSet<mir::BasicBlock>,
394404
body: &'a Body<'tcx>,
395405
}
396406

397-
impl<'a, 'tcx, O> DataflowAnalysis<'a, 'tcx, O> where O: BitDenotation<'tcx>
407+
impl<'a, 'tcx, O> DataflowAnalysis<'a, 'tcx, O>
408+
where
409+
O: BitDenotation<'tcx>,
398410
{
399411
pub fn results(self) -> DataflowResults<'tcx, O> {
400412
DataflowResults(self.flow_state)
@@ -734,7 +746,10 @@ impl<'a, 'tcx, D> DataflowAnalysis<'a, 'tcx, D> where D: BitDenotation<'tcx>
734746
}
735747
}
736748

737-
impl<'a, 'tcx, D> DataflowAnalysis<'a, 'tcx, D> where D: BitDenotation<'tcx> {
749+
impl<'a, 'tcx, D> DataflowAnalysis<'a, 'tcx, D>
750+
where
751+
D: BitDenotation<'tcx>,
752+
{
738753
/// Propagates the bits of `in_out` into all the successors of `bb`,
739754
/// using bitwise operator denoted by `self.operator`.
740755
///

src/librustc_mir/hair/cx/to_ref.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ impl<'tcx> ToRef for Expr<'tcx> {
3333
}
3434

3535
impl<'tcx, T, U> ToRef for &'tcx Option<T>
36-
where &'tcx T: ToRef<Output = U>
36+
where
37+
&'tcx T: ToRef<Output = U>,
3738
{
3839
type Output = Option<U>;
3940

@@ -43,7 +44,8 @@ impl<'tcx, T, U> ToRef for &'tcx Option<T>
4344
}
4445

4546
impl<'tcx, T, U> ToRef for &'tcx Vec<T>
46-
where &'tcx T: ToRef<Output = U>
47+
where
48+
&'tcx T: ToRef<Output = U>,
4749
{
4850
type Output = Vec<U>;
4951

@@ -53,7 +55,8 @@ impl<'tcx, T, U> ToRef for &'tcx Vec<T>
5355
}
5456

5557
impl<'tcx, T, U> ToRef for &'tcx P<[T]>
56-
where &'tcx T: ToRef<Output = U>
58+
where
59+
&'tcx T: ToRef<Output = U>,
5760
{
5861
type Output = Vec<U>;
5962

0 commit comments

Comments
 (0)