1
Fork 0

Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrum

Update bootstrap compiler and rustfmt

The rustfmt version we previously used formats things differently from what the latest nightly rustfmt does. This causes issues for subtrees that get formatted both in-tree and in their own repo. Updating the rustfmt used in-tree solves those issues. Also bumped the bootstrap compiler as the stage0 update command always updates both at the same
time.
This commit is contained in:
bors 2025-02-09 15:44:16 +00:00
commit 124cc92199
289 changed files with 6351 additions and 5071 deletions

View file

@ -317,10 +317,13 @@ impl<Prov: Provenance, Bytes: AllocBytes> Allocation<Prov, (), Bytes> {
Ok(Allocation {
bytes,
provenance: ProvenanceMap::new(),
init_mask: InitMask::new(size, match init {
AllocInit::Uninit => false,
AllocInit::Zero => true,
}),
init_mask: InitMask::new(
size,
match init {
AllocInit::Uninit => false,
AllocInit::Zero => true,
},
),
align,
mutability: Mutability::Mut,
extra: (),

View file

@ -1410,10 +1410,10 @@ impl<'tcx> BasicBlockData<'tcx> {
// existing elements from before the gap to the end of the gap.
// For now, this is safe code, emulating a gap but initializing it.
let mut gap = self.statements.len()..self.statements.len() + extra_stmts;
self.statements.resize(gap.end, Statement {
source_info: SourceInfo::outermost(DUMMY_SP),
kind: StatementKind::Nop,
});
self.statements.resize(
gap.end,
Statement { source_info: SourceInfo::outermost(DUMMY_SP), kind: StatementKind::Nop },
);
for (splice_start, new_stmts) in splices.into_iter().rev() {
let splice_end = splice_start + new_stmts.size_hint().0;
while gap.end > splice_end {

View file

@ -327,15 +327,18 @@ impl OnDiskCache {
// Encode the file footer.
let footer_pos = encoder.position() as u64;
encoder.encode_tagged(TAG_FILE_FOOTER, &Footer {
file_index_to_stable_id,
query_result_index,
side_effects_index,
interpret_alloc_index,
syntax_contexts,
expn_data,
foreign_expn_data,
});
encoder.encode_tagged(
TAG_FILE_FOOTER,
&Footer {
file_index_to_stable_id,
query_result_index,
side_effects_index,
interpret_alloc_index,
syntax_contexts,
expn_data,
foreign_expn_data,
},
);
// Encode the position of the footer as the last 8 bytes of the
// file so we know where to look for it.

View file

@ -1094,10 +1094,13 @@ impl<'tcx> CommonLifetimes<'tcx> {
.map(|i| {
(0..NUM_PREINTERNED_RE_LATE_BOUNDS_V)
.map(|v| {
mk(ty::ReBound(ty::DebruijnIndex::from(i), ty::BoundRegion {
var: ty::BoundVar::from(v),
kind: ty::BoundRegionKind::Anon,
}))
mk(ty::ReBound(
ty::DebruijnIndex::from(i),
ty::BoundRegion {
var: ty::BoundVar::from(v),
kind: ty::BoundRegionKind::Anon,
},
))
})
.collect()
})
@ -3146,12 +3149,15 @@ impl<'tcx> TyCtxt<'tcx> {
}
let generics = self.generics_of(new_parent);
return ty::Region::new_early_param(self, ty::EarlyParamRegion {
index: generics
.param_def_id_to_index(self, ebv.to_def_id())
.expect("early-bound var should be present in fn generics"),
name: self.item_name(ebv.to_def_id()),
});
return ty::Region::new_early_param(
self,
ty::EarlyParamRegion {
index: generics
.param_def_id_to_index(self, ebv.to_def_id())
.expect("early-bound var should be present in fn generics"),
name: self.item_name(ebv.to_def_id()),
},
);
}
resolve_bound_vars::ResolvedArg::LateBound(_, _, lbv) => {
let new_parent = self.local_parent(lbv);

View file

@ -280,21 +280,26 @@ impl<'tcx> TyCtxt<'tcx> {
T: TypeFoldable<TyCtxt<'tcx>>,
{
let shift_bv = |bv: ty::BoundVar| ty::BoundVar::from_usize(bv.as_usize() + bound_vars);
self.replace_escaping_bound_vars_uncached(value, FnMutDelegate {
regions: &mut |r: ty::BoundRegion| {
ty::Region::new_bound(self, ty::INNERMOST, ty::BoundRegion {
var: shift_bv(r.var),
kind: r.kind,
})
self.replace_escaping_bound_vars_uncached(
value,
FnMutDelegate {
regions: &mut |r: ty::BoundRegion| {
ty::Region::new_bound(
self,
ty::INNERMOST,
ty::BoundRegion { var: shift_bv(r.var), kind: r.kind },
)
},
types: &mut |t: ty::BoundTy| {
Ty::new_bound(
self,
ty::INNERMOST,
ty::BoundTy { var: shift_bv(t.var), kind: t.kind },
)
},
consts: &mut |c| ty::Const::new_bound(self, ty::INNERMOST, shift_bv(c)),
},
types: &mut |t: ty::BoundTy| {
Ty::new_bound(self, ty::INNERMOST, ty::BoundTy {
var: shift_bv(t.var),
kind: t.kind,
})
},
consts: &mut |c| ty::Const::new_bound(self, ty::INNERMOST, shift_bv(c)),
})
)
}
/// Replaces any late-bound regions bound in `value` with `'erased`. Useful in codegen but also

View file

@ -1369,10 +1369,11 @@ pub trait FnAbiOf<'tcx>: FnAbiOfHelpers<'tcx> {
// `def_span` unconditionally (which may have a perf penalty).
let span =
if !span.is_dummy() { span } else { tcx.def_span(instance.def_id()) };
self.handle_fn_abi_err(*err, span, FnAbiRequest::OfInstance {
instance,
extra_args,
})
self.handle_fn_abi_err(
*err,
span,
FnAbiRequest::OfInstance { instance, extra_args },
)
}),
)
}

View file

@ -759,10 +759,11 @@ impl<'tcx> TyCtxt<'tcx> {
assert_eq!(re, self.lifetimes.re_erased);
let var = ty::BoundVar::from_usize(vars.len());
vars.push(ty::BoundVariableKind::Region(ty::BoundRegionKind::Anon));
ty::Region::new_bound(self, debruijn, ty::BoundRegion {
var,
kind: ty::BoundRegionKind::Anon,
})
ty::Region::new_bound(
self,
debruijn,
ty::BoundRegion { var, kind: ty::BoundRegionKind::Anon },
)
});
ty::EarlyBinder::bind(ty::Binder::bind_with_vars(
ty,