diff options
| author | bors <bors@rust-lang.org> | 2025-02-09 15:44:16 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-02-09 15:44:16 +0000 |
| commit | 124cc92199ffa924f6b4c7cc819a85b65e0c3984 (patch) | |
| tree | 7618e5ba778c9a8083f526a72dc9414ced99df02 /compiler/rustc_const_eval/src | |
| parent | a26e97be8826d408309fffbd8168362365719f50 (diff) | |
| parent | 1fcae03369abb4c2cc180cd5a49e1f4440a81300 (diff) | |
| download | rust-124cc92199ffa924f6b4c7cc819a85b65e0c3984.tar.gz rust-124cc92199ffa924f6b4c7cc819a85b65e0c3984.zip | |
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.
Diffstat (limited to 'compiler/rustc_const_eval/src')
| -rw-r--r-- | compiler/rustc_const_eval/src/check_consts/qualifs.rs | 14 | ||||
| -rw-r--r-- | compiler/rustc_const_eval/src/errors.rs | 11 | ||||
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/call.rs | 22 | ||||
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/intern.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/validity.rs | 25 |
5 files changed, 46 insertions, 36 deletions
diff --git a/compiler/rustc_const_eval/src/check_consts/qualifs.rs b/compiler/rustc_const_eval/src/check_consts/qualifs.rs index 9c99782d223..dfcd1969a73 100644 --- a/compiler/rustc_const_eval/src/check_consts/qualifs.rs +++ b/compiler/rustc_const_eval/src/check_consts/qualifs.rs @@ -188,12 +188,14 @@ impl Qualif for NeedsNonConstDrop { ObligationCause::misc(cx.body.span, cx.def_id()), param_env, ty::Binder::dummy(ty::TraitRef::new(cx.tcx, destruct_def_id, [ty])) - .to_host_effect_clause(cx.tcx, match cx.const_kind() { - rustc_hir::ConstContext::ConstFn => ty::BoundConstness::Maybe, - rustc_hir::ConstContext::Static(_) | rustc_hir::ConstContext::Const { .. } => { - ty::BoundConstness::Const - } - }), + .to_host_effect_clause( + cx.tcx, + match cx.const_kind() { + rustc_hir::ConstContext::ConstFn => ty::BoundConstness::Maybe, + rustc_hir::ConstContext::Static(_) + | rustc_hir::ConstContext::Const { .. } => ty::BoundConstness::Const, + }, + ), )); !ocx.select_all_or_error().is_empty() } diff --git a/compiler/rustc_const_eval/src/errors.rs b/compiler/rustc_const_eval/src/errors.rs index a2635885098..8df9877cabc 100644 --- a/compiler/rustc_const_eval/src/errors.rs +++ b/compiler/rustc_const_eval/src/errors.rs @@ -578,10 +578,13 @@ impl<'a> ReportErrorExt for UndefinedBehaviorInfo<'a> { } ShiftOverflow { intrinsic, shift_amount } => { diag.arg("intrinsic", intrinsic); - diag.arg("shift_amount", match shift_amount { - Either::Left(v) => v.to_string(), - Either::Right(v) => v.to_string(), - }); + diag.arg( + "shift_amount", + match shift_amount { + Either::Left(v) => v.to_string(), + Either::Right(v) => v.to_string(), + }, + ); } BoundsCheckFailed { len, index } => { diag.arg("len", len); diff --git a/compiler/rustc_const_eval/src/interpret/call.rs b/compiler/rustc_const_eval/src/interpret/call.rs index e2e6e16d8a7..cdf706f3752 100644 --- a/compiler/rustc_const_eval/src/interpret/call.rs +++ b/compiler/rustc_const_eval/src/interpret/call.rs @@ -381,10 +381,13 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { "caller ABI: {:#?}, args: {:#?}", caller_fn_abi, args.iter() - .map(|arg| (arg.layout().ty, match arg { - FnArg::Copy(op) => format!("copy({op:?})"), - FnArg::InPlace(mplace) => format!("in-place({mplace:?})"), - })) + .map(|arg| ( + arg.layout().ty, + match arg { + FnArg::Copy(op) => format!("copy({op:?})"), + FnArg::InPlace(mplace) => format!("in-place({mplace:?})"), + } + )) .collect::<Vec<_>>() ); trace!( @@ -874,10 +877,13 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { ); // Check `unwinding`. - assert_eq!(unwinding, match self.frame().loc { - Left(loc) => self.body().basic_blocks[loc.block].is_cleanup, - Right(_) => true, - }); + assert_eq!( + unwinding, + match self.frame().loc { + Left(loc) => self.body().basic_blocks[loc.block].is_cleanup, + Right(_) => true, + } + ); if unwinding && self.frame_idx() == 0 { throw_ub_custom!(fluent::const_eval_unwind_past_top); } diff --git a/compiler/rustc_const_eval/src/interpret/intern.rs b/compiler/rustc_const_eval/src/interpret/intern.rs index 0cbb3b157f3..e14cc1dad36 100644 --- a/compiler/rustc_const_eval/src/interpret/intern.rs +++ b/compiler/rustc_const_eval/src/interpret/intern.rs @@ -102,11 +102,11 @@ fn intern_as_new_static<'tcx>( alloc_id: AllocId, alloc: ConstAllocation<'tcx>, ) { - let feed = tcx.create_def(static_id, sym::nested, DefKind::Static { - safety: hir::Safety::Safe, - mutability: alloc.0.mutability, - nested: true, - }); + let feed = tcx.create_def( + static_id, + sym::nested, + DefKind::Static { safety: hir::Safety::Safe, mutability: alloc.0.mutability, nested: true }, + ); tcx.set_nested_alloc_id_static(alloc_id, feed.def_id()); if tcx.is_thread_local_static(static_id.into()) { diff --git a/compiler/rustc_const_eval/src/interpret/validity.rs b/compiler/rustc_const_eval/src/interpret/validity.rs index 8e544798742..0ac34f4633b 100644 --- a/compiler/rustc_const_eval/src/interpret/validity.rs +++ b/compiler/rustc_const_eval/src/interpret/validity.rs @@ -812,10 +812,10 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValidityVisitor<'rt, 'tcx, M> { if start == 1 && end == max_value { // Only null is the niche. So make sure the ptr is NOT null. if self.ecx.scalar_may_be_null(scalar)? { - throw_validation_failure!(self.path, NullablePtrOutOfRange { - range: valid_range, - max_value - }) + throw_validation_failure!( + self.path, + NullablePtrOutOfRange { range: valid_range, max_value } + ) } else { return interp_ok(()); } @@ -825,10 +825,10 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValidityVisitor<'rt, 'tcx, M> { } else { // Conservatively, we reject, because the pointer *could* have a bad // value. - throw_validation_failure!(self.path, PtrOutOfRange { - range: valid_range, - max_value - }) + throw_validation_failure!( + self.path, + PtrOutOfRange { range: valid_range, max_value } + ) } } }; @@ -836,11 +836,10 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValidityVisitor<'rt, 'tcx, M> { if valid_range.contains(bits) { interp_ok(()) } else { - throw_validation_failure!(self.path, OutOfRange { - value: format!("{bits}"), - range: valid_range, - max_value - }) + throw_validation_failure!( + self.path, + OutOfRange { value: format!("{bits}"), range: valid_range, max_value } + ) } } |
