Skip to content

Commit 404c847

Browse files
committed
Auto merge of rust-lang#91902 - matthiaskrgr:rollup-hjjyhow, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - rust-lang#91529 (add BinaryHeap::try_reserve and BinaryHeap::try_reserve_exact) - rust-lang#91820 (Suggest to specify a target triple when lang item is missing) - rust-lang#91851 (Make `MaybeUninit::zeroed` `const`) - rust-lang#91875 (Use try_normalize_erasing_regions in RevealAllVisitor) - rust-lang#91887 (Remove `in_band_lifetimes` from `rustc_const_eval`) - rust-lang#91892 (Fix HashStable implementation on InferTy) - rust-lang#91893 (Remove `in_band_lifetimes` from `rustc_hir`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 83b32f2 + 1dde0db commit 404c847

File tree

31 files changed

+271
-98
lines changed

31 files changed

+271
-98
lines changed

compiler/rustc_const_eval/src/const_eval/machine.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -423,14 +423,14 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
423423
}
424424

425425
#[inline(always)]
426-
fn stack(
426+
fn stack<'a>(
427427
ecx: &'a InterpCx<'mir, 'tcx, Self>,
428428
) -> &'a [Frame<'mir, 'tcx, Self::PointerTag, Self::FrameExtra>] {
429429
&ecx.machine.stack
430430
}
431431

432432
#[inline(always)]
433-
fn stack_mut(
433+
fn stack_mut<'a>(
434434
ecx: &'a mut InterpCx<'mir, 'tcx, Self>,
435435
) -> &'a mut Vec<Frame<'mir, 'tcx, Self::PointerTag, Self::FrameExtra>> {
436436
&mut ecx.machine.stack

compiler/rustc_const_eval/src/const_eval/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ pub use fn_queries::*;
2525
pub use machine::*;
2626

2727
pub(crate) fn const_caller_location(
28-
tcx: TyCtxt<'tcx>,
28+
tcx: TyCtxt<'_>,
2929
(file, line, col): (Symbol, u32, u32),
30-
) -> ConstValue<'tcx> {
30+
) -> ConstValue<'_> {
3131
trace!("const_caller_location: {}:{}:{}", file, line, col);
3232
let mut ecx = mk_eval_cx(tcx, DUMMY_SP, ty::ParamEnv::reveal_all(), false);
3333

compiler/rustc_const_eval/src/interpret/eval_context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
935935
}
936936

937937
#[must_use]
938-
pub fn dump_place(&'a self, place: Place<M::PointerTag>) -> PlacePrinter<'a, 'mir, 'tcx, M> {
938+
pub fn dump_place(&self, place: Place<M::PointerTag>) -> PlacePrinter<'_, 'mir, 'tcx, M> {
939939
PlacePrinter { ecx: self, place }
940940
}
941941

compiler/rustc_const_eval/src/interpret/intern.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -292,14 +292,15 @@ pub enum InternKind {
292292
/// Any errors here would anyway be turned into `const_err` lints, whereas validation failures
293293
/// are hard errors.
294294
#[tracing::instrument(level = "debug", skip(ecx))]
295-
pub fn intern_const_alloc_recursive<M: CompileTimeMachine<'mir, 'tcx, const_eval::MemoryKind>>(
295+
pub fn intern_const_alloc_recursive<
296+
'mir,
297+
'tcx: 'mir,
298+
M: CompileTimeMachine<'mir, 'tcx, const_eval::MemoryKind>,
299+
>(
296300
ecx: &mut InterpCx<'mir, 'tcx, M>,
297301
intern_kind: InternKind,
298302
ret: &MPlaceTy<'tcx>,
299-
) -> Result<(), ErrorReported>
300-
where
301-
'tcx: 'mir,
302-
{
303+
) -> Result<(), ErrorReported> {
303304
let tcx = ecx.tcx;
304305
let base_intern_mode = match intern_kind {
305306
InternKind::Static(mutbl) => InternMode::Static(mutbl),

compiler/rustc_const_eval/src/interpret/intrinsics/type_name.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ impl<'tcx> Printer<'tcx> for AbsolutePathPrinter<'tcx> {
148148
}
149149
}
150150

151-
impl PrettyPrinter<'tcx> for AbsolutePathPrinter<'tcx> {
151+
impl<'tcx> PrettyPrinter<'tcx> for AbsolutePathPrinter<'tcx> {
152152
fn region_should_not_be_omitted(&self, _region: ty::Region<'_>) -> bool {
153153
false
154154
}

compiler/rustc_const_eval/src/interpret/machine.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,12 @@ pub trait Machine<'mir, 'tcx>: Sized {
374374
) -> InterpResult<'tcx, Frame<'mir, 'tcx, Self::PointerTag, Self::FrameExtra>>;
375375

376376
/// Borrow the current thread's stack.
377-
fn stack(
377+
fn stack<'a>(
378378
ecx: &'a InterpCx<'mir, 'tcx, Self>,
379379
) -> &'a [Frame<'mir, 'tcx, Self::PointerTag, Self::FrameExtra>];
380380

381381
/// Mutably borrow the current thread's stack.
382-
fn stack_mut(
382+
fn stack_mut<'a>(
383383
ecx: &'a mut InterpCx<'mir, 'tcx, Self>,
384384
) -> &'a mut Vec<Frame<'mir, 'tcx, Self::PointerTag, Self::FrameExtra>>;
385385

compiler/rustc_const_eval/src/interpret/operand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ pub struct ImmTy<'tcx, Tag: Provenance = AllocId> {
106106
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
107107
rustc_data_structures::static_assert_size!(ImmTy<'_>, 72);
108108

109-
impl<Tag: Provenance> std::fmt::Display for ImmTy<'tcx, Tag> {
109+
impl<Tag: Provenance> std::fmt::Display for ImmTy<'_, Tag> {
110110
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
111111
/// Helper function for printing a scalar to a FmtPrinter
112112
fn p<'a, 'tcx, F: std::fmt::Write, Tag: Provenance>(

compiler/rustc_const_eval/src/interpret/place.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl<Tag: Provenance> MemPlace<Tag> {
150150
}
151151

152152
#[inline]
153-
pub fn offset(
153+
pub fn offset<'tcx>(
154154
self,
155155
offset: Size,
156156
meta: MemPlaceMeta<Tag>,
@@ -420,7 +420,7 @@ where
420420

421421
// Iterates over all fields of an array. Much more efficient than doing the
422422
// same by repeatedly calling `mplace_array`.
423-
pub(super) fn mplace_array_fields(
423+
pub(super) fn mplace_array_fields<'a>(
424424
&self,
425425
base: &'a MPlaceTy<'tcx, Tag>,
426426
) -> InterpResult<'tcx, impl Iterator<Item = InterpResult<'tcx, MPlaceTy<'tcx, Tag>>> + 'a>

compiler/rustc_const_eval/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Rust MIR: a lowered representation of Rust.
1111
#![feature(crate_visibility_modifier)]
1212
#![feature(decl_macro)]
1313
#![feature(exact_size_is_empty)]
14-
#![feature(in_band_lifetimes)]
1514
#![feature(iter_zip)]
1615
#![feature(let_else)]
1716
#![feature(map_try_insert)]

compiler/rustc_const_eval/src/transform/check_consts/check.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub struct Qualifs<'mir, 'tcx> {
3535
needs_non_const_drop: Option<QualifResults<'mir, 'tcx, NeedsNonConstDrop>>,
3636
}
3737

38-
impl Qualifs<'mir, 'tcx> {
38+
impl<'mir, 'tcx> Qualifs<'mir, 'tcx> {
3939
/// Returns `true` if `local` is `NeedsDrop` at the given `Location`.
4040
///
4141
/// Only updates the cursor if absolutely necessary
@@ -185,15 +185,15 @@ pub struct Checker<'mir, 'tcx> {
185185
secondary_errors: Vec<Diagnostic>,
186186
}
187187

188-
impl Deref for Checker<'mir, 'tcx> {
188+
impl<'mir, 'tcx> Deref for Checker<'mir, 'tcx> {
189189
type Target = ConstCx<'mir, 'tcx>;
190190

191191
fn deref(&self) -> &Self::Target {
192192
&self.ccx
193193
}
194194
}
195195

196-
impl Checker<'mir, 'tcx> {
196+
impl<'mir, 'tcx> Checker<'mir, 'tcx> {
197197
pub fn new(ccx: &'mir ConstCx<'mir, 'tcx>) -> Self {
198198
Checker {
199199
span: ccx.body.span,
@@ -273,7 +273,7 @@ impl Checker<'mir, 'tcx> {
273273
struct StorageDeads {
274274
locals: BitSet<Local>,
275275
}
276-
impl Visitor<'tcx> for StorageDeads {
276+
impl<'tcx> Visitor<'tcx> for StorageDeads {
277277
fn visit_statement(&mut self, stmt: &Statement<'tcx>, _: Location) {
278278
if let StatementKind::StorageDead(l) = stmt.kind {
279279
self.locals.insert(l);
@@ -460,7 +460,7 @@ impl Checker<'mir, 'tcx> {
460460
}
461461
}
462462

463-
impl Visitor<'tcx> for Checker<'mir, 'tcx> {
463+
impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
464464
fn visit_basic_block_data(&mut self, bb: BasicBlock, block: &BasicBlockData<'tcx>) {
465465
trace!("visit_basic_block_data: bb={:?} is_cleanup={:?}", bb, block.is_cleanup);
466466

@@ -1042,7 +1042,7 @@ impl Visitor<'tcx> for Checker<'mir, 'tcx> {
10421042
}
10431043
}
10441044

1045-
fn place_as_reborrow(
1045+
fn place_as_reborrow<'tcx>(
10461046
tcx: TyCtxt<'tcx>,
10471047
body: &Body<'tcx>,
10481048
place: Place<'tcx>,

compiler/rustc_const_eval/src/transform/check_consts/mod.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub struct ConstCx<'mir, 'tcx> {
2828
pub const_kind: Option<hir::ConstContext>,
2929
}
3030

31-
impl ConstCx<'mir, 'tcx> {
31+
impl<'mir, 'tcx> ConstCx<'mir, 'tcx> {
3232
pub fn new(tcx: TyCtxt<'tcx>, body: &'mir mir::Body<'tcx>) -> Self {
3333
let def_id = body.source.def_id().expect_local();
3434
let param_env = tcx.param_env(def_id);
@@ -72,11 +72,7 @@ impl ConstCx<'mir, 'tcx> {
7272
}
7373
}
7474

75-
pub fn rustc_allow_const_fn_unstable(
76-
tcx: TyCtxt<'tcx>,
77-
def_id: DefId,
78-
feature_gate: Symbol,
79-
) -> bool {
75+
pub fn rustc_allow_const_fn_unstable(tcx: TyCtxt<'_>, def_id: DefId, feature_gate: Symbol) -> bool {
8076
let attrs = tcx.get_attrs(def_id);
8177
attr::rustc_allow_const_fn_unstable(&tcx.sess, attrs).any(|name| name == feature_gate)
8278
}
@@ -89,7 +85,7 @@ pub fn rustc_allow_const_fn_unstable(
8985
// functions can be called in a const-context by users of the stable compiler. "const-stable"
9086
// functions are subject to more stringent restrictions than "const-unstable" functions: They
9187
// cannot use unstable features and can only call other "const-stable" functions.
92-
pub fn is_const_stable_const_fn(tcx: TyCtxt<'tcx>, def_id: DefId) -> bool {
88+
pub fn is_const_stable_const_fn(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
9389
use attr::{ConstStability, Stability, StabilityLevel};
9490

9591
// A default body marked const is not const-stable because const

0 commit comments

Comments
 (0)