Skip to content

Commit 182ed85

Browse files
committed
Address review comments
1 parent 90708c1 commit 182ed85

29 files changed

+133
-128
lines changed

compiler/rustc_middle/src/mir/interpret/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::{AllocId, Pointer, RawConst, Scalar};
1+
use super::{AllocId, ConstAlloc, Pointer, Scalar};
22

33
use crate::mir::interpret::ConstValue;
44
use crate::ty::{layout, query::TyCtxtAt, tls, FnSig, Ty};
@@ -27,7 +27,7 @@ CloneTypeFoldableAndLiftImpls! {
2727
ErrorHandled,
2828
}
2929

30-
pub type EvalToAllocationRawResult<'tcx> = Result<RawConst<'tcx>, ErrorHandled>;
30+
pub type EvalToAllocationRawResult<'tcx> = Result<ConstAlloc<'tcx>, ErrorHandled>;
3131
pub type EvalToConstValueResult<'tcx> = Result<ConstValue<'tcx>, ErrorHandled>;
3232

3333
pub fn struct_error<'tcx>(tcx: TyCtxtAt<'tcx>, msg: &str) -> DiagnosticBuilder<'tcx> {

compiler/rustc_middle/src/mir/interpret/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub use self::error::{
123123
ResourceExhaustionInfo, UndefinedBehaviorInfo, UninitBytesAccess, UnsupportedOpInfo,
124124
};
125125

126-
pub use self::value::{get_slice_bytes, ConstValue, RawConst, Scalar, ScalarMaybeUninit};
126+
pub use self::value::{get_slice_bytes, ConstAlloc, ConstValue, Scalar, ScalarMaybeUninit};
127127

128128
pub use self::allocation::{Allocation, AllocationExtra, InitMask, Relocations};
129129

compiler/rustc_middle/src/mir/interpret/value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use super::{sign_extend, truncate, AllocId, Allocation, InterpResult, Pointer, P
1414

1515
/// Represents the result of const evaluation via the `eval_to_allocation` query.
1616
#[derive(Clone, HashStable)]
17-
pub struct RawConst<'tcx> {
17+
pub struct ConstAlloc<'tcx> {
1818
// the value lives here, at offset 0, and that allocation definitely is a `AllocKind::Memory`
1919
// (so you can use `AllocMap::unwrap_memory`).
2020
pub alloc_id: AllocId,

compiler/rustc_middle/src/query/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ rustc_queries! {
713713
query eval_to_allocation_raw(key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>)
714714
-> EvalToAllocationRawResult<'tcx> {
715715
desc { |tcx|
716-
"const-evaluating `{}`",
716+
"const-evaluating + checking `{}`",
717717
key.value.display(tcx)
718718
}
719719
}
@@ -727,7 +727,7 @@ rustc_queries! {
727727
query eval_to_const_value(key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>)
728728
-> EvalToConstValueResult<'tcx> {
729729
desc { |tcx|
730-
"const-evaluating + checking `{}`",
730+
"simplifying constant for the type system `{}`",
731731
key.value.display(tcx)
732732
}
733733
cache_on_disk_if(_, opt_result) {

compiler/rustc_mir/src/const_eval/eval_queries.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use super::{CompileTimeEvalContext, CompileTimeInterpreter, ConstEvalErr, Memory
22
use crate::interpret::eval_nullary_intrinsic;
33
use crate::interpret::{
44
intern_const_alloc_recursive, Allocation, ConstValue, GlobalId, Immediate, InternKind,
5-
InterpCx, InterpResult, MPlaceTy, MemoryKind, OpTy, RawConst, RefTracking, Scalar,
5+
InterpCx, InterpResult, MPlaceTy, MemoryKind, OpTy, ConstAlloc, RefTracking, Scalar,
66
ScalarMaybeUninit, StackPopCleanup,
77
};
88

@@ -184,9 +184,9 @@ pub(super) fn op_to_const<'tcx>(
184184
}
185185
}
186186

187-
fn turn_into_const<'tcx>(
187+
fn turn_into_const_value<'tcx>(
188188
tcx: TyCtxt<'tcx>,
189-
constant: RawConst<'tcx>,
189+
constant: ConstAlloc<'tcx>,
190190
key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>,
191191
) -> ConstValue<'tcx> {
192192
let cid = key.value;
@@ -237,7 +237,7 @@ pub fn eval_to_const_value_provider<'tcx>(
237237
});
238238
}
239239

240-
tcx.eval_to_allocation_raw(key).map(|val| turn_into_const(tcx, val, key))
240+
tcx.eval_to_allocation_raw(key).map(|val| turn_into_const_value(tcx, val, key))
241241
}
242242

243243
pub fn eval_to_allocation_raw_provider<'tcx>(
@@ -402,7 +402,7 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
402402
))
403403
} else {
404404
// Convert to raw constant
405-
Ok(RawConst { alloc_id: mplace.ptr.assert_ptr().alloc_id, ty: mplace.layout.ty })
405+
Ok(ConstAlloc { alloc_id: mplace.ptr.assert_ptr().alloc_id, ty: mplace.layout.ty })
406406
}
407407
}
408408
}

compiler/rustc_mir/src/interpret/memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
469469
// Notice that every static has two `AllocId` that will resolve to the same
470470
// thing here: one maps to `GlobalAlloc::Static`, this is the "lazy" ID,
471471
// and the other one is maps to `GlobalAlloc::Memory`, this is returned by
472-
// `const_eval` and it is the "resolved" ID.
472+
// `eval_static_initializer` and it is the "resolved" ID.
473473
// The resolved ID is never used by the interpreted program, it is hidden.
474474
// This is relied upon for soundness of const-patterns; a pointer to the resolved
475475
// ID would "sidestep" the checks that make sure consts do not point to statics!

compiler/rustc_mir/src/interpret/place.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ use rustc_target::abi::{Abi, Align, FieldsShape, TagEncoding};
1313
use rustc_target::abi::{HasDataLayout, LayoutOf, Size, VariantIdx, Variants};
1414

1515
use super::{
16-
mir_assign_valid_types, truncate, AllocId, AllocMap, Allocation, AllocationExtra, ImmTy,
17-
Immediate, InterpCx, InterpResult, LocalValue, Machine, MemoryKind, OpTy, Operand, Pointer,
18-
PointerArithmetic, RawConst, Scalar, ScalarMaybeUninit,
16+
mir_assign_valid_types, truncate, AllocId, AllocMap, Allocation, AllocationExtra, ConstAlloc,
17+
ImmTy, Immediate, InterpCx, InterpResult, LocalValue, Machine, MemoryKind, OpTy, Operand,
18+
Pointer, PointerArithmetic, Scalar, ScalarMaybeUninit,
1919
};
2020

2121
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, HashStable)]
@@ -1122,7 +1122,7 @@ where
11221122

11231123
pub fn raw_const_to_mplace(
11241124
&self,
1125-
raw: RawConst<'tcx>,
1125+
raw: ConstAlloc<'tcx>,
11261126
) -> InterpResult<'tcx, MPlaceTy<'tcx, M::PointerTag>> {
11271127
// This must be an allocation in `tcx`
11281128
let _ = self.tcx.global_alloc(raw.alloc_id);

compiler/rustc_mir/src/interpret/validity.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -426,27 +426,27 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
426426
if let Some(GlobalAlloc::Static(did)) = alloc_kind {
427427
assert!(!self.ecx.tcx.is_thread_local_static(did));
428428
assert!(self.ecx.tcx.is_static(did));
429-
// See const_eval::machine::MemoryExtra::can_access_statics for why
430-
// this check is so important.
431-
// This check is reachable when the const just referenced the static,
432-
// but never read it (so we never entered `before_access_global`).
433-
// We also need to do it here instead of going on to avoid running
434-
// into the `before_access_global` check during validation.
435-
if !self.may_ref_to_static {
429+
if self.may_ref_to_static {
430+
// We skip checking other statics. These statics must be sound by
431+
// themselves, and the only way to get broken statics here is by using
432+
// unsafe code.
433+
// The reasons we don't check other statics is twofold. For one, in all
434+
// sound cases, the static was already validated on its own, and second, we
435+
// trigger cycle errors if we try to compute the value of the other static
436+
// and that static refers back to us.
437+
// We might miss const-invalid data,
438+
// but things are still sound otherwise (in particular re: consts
439+
// referring to statics).
440+
return Ok(());
441+
} else {
442+
// See const_eval::machine::MemoryExtra::can_access_statics for why
443+
// this check is so important.
444+
// This check is reachable when the const just referenced the static,
445+
// but never read it (so we never entered `before_access_global`).
436446
throw_validation_failure!(self.path,
437447
{ "a {} pointing to a static variable", kind }
438448
);
439449
}
440-
// We skip checking other statics. These statics must be sound by themselves,
441-
// and the only way to get broken statics here is by using unsafe code.
442-
// The reasons we don't check other statics is twofold. For one, in all sound
443-
// cases, the static was already validated on its own, and second, we trigger
444-
// cycle errors if we try to compute the value of the other static and that
445-
// static refers back to us.
446-
// We might miss const-invalid data,
447-
// but things are still sound otherwise (in particular re: consts
448-
// referring to statics).
449-
return Ok(());
450450
}
451451
}
452452
// Proceed recursively even for ZST, no reason to skip them!

src/test/ui/associated-const/defaults-cyclic-fail.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
error[E0391]: cycle detected when normalizing `<() as Tr>::A`
22
|
3-
note: ...which requires const-evaluating + checking `Tr::A`...
3+
note: ...which requires simplifying constant for the type system `Tr::A`...
44
--> $DIR/defaults-cyclic-fail.rs:6:5
55
|
66
LL | const A: u8 = Self::B;
77
| ^^^^^^^^^^^^^^^^^^^^^^
8-
note: ...which requires const-evaluating + checking `Tr::A`...
8+
note: ...which requires simplifying constant for the type system `Tr::A`...
99
--> $DIR/defaults-cyclic-fail.rs:6:5
1010
|
1111
LL | const A: u8 = Self::B;
1212
| ^^^^^^^^^^^^^^^^^^^^^^
13-
note: ...which requires const-evaluating `Tr::A`...
13+
note: ...which requires const-evaluating + checking `Tr::A`...
1414
--> $DIR/defaults-cyclic-fail.rs:6:5
1515
|
1616
LL | const A: u8 = Self::B;
1717
| ^^^^^^^^^^^^^^^^^^^^^^
1818
= note: ...which requires normalizing `<() as Tr>::B`...
19-
note: ...which requires const-evaluating + checking `Tr::B`...
19+
note: ...which requires simplifying constant for the type system `Tr::B`...
2020
--> $DIR/defaults-cyclic-fail.rs:8:5
2121
|
2222
LL | const B: u8 = Self::A;
2323
| ^^^^^^^^^^^^^^^^^^^^^^
24-
note: ...which requires const-evaluating + checking `Tr::B`...
24+
note: ...which requires simplifying constant for the type system `Tr::B`...
2525
--> $DIR/defaults-cyclic-fail.rs:8:5
2626
|
2727
LL | const B: u8 = Self::A;
2828
| ^^^^^^^^^^^^^^^^^^^^^^
29-
note: ...which requires const-evaluating `Tr::B`...
29+
note: ...which requires const-evaluating + checking `Tr::B`...
3030
--> $DIR/defaults-cyclic-fail.rs:8:5
3131
|
3232
LL | const B: u8 = Self::A;
3333
| ^^^^^^^^^^^^^^^^^^^^^^
3434
= note: ...which again requires normalizing `<() as Tr>::A`, completing the cycle
35-
note: cycle used when const-evaluating `main::promoted[2]`
35+
note: cycle used when const-evaluating + checking `main::promoted[2]`
3636
--> $DIR/defaults-cyclic-fail.rs:14:1
3737
|
3838
LL | fn main() {

src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
error[E0391]: cycle detected when const-evaluating + checking `IMPL_REF_BAR`
1+
error[E0391]: cycle detected when simplifying constant for the type system `IMPL_REF_BAR`
22
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
33
|
44
LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
note: ...which requires const-evaluating + checking `IMPL_REF_BAR`...
7+
note: ...which requires simplifying constant for the type system `IMPL_REF_BAR`...
88
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
99
|
1010
LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12-
note: ...which requires const-evaluating `IMPL_REF_BAR`...
12+
note: ...which requires const-evaluating + checking `IMPL_REF_BAR`...
1313
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
1414
|
1515
LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
1616
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1717
= note: ...which requires normalizing `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
18-
note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
18+
note: ...which requires simplifying constant for the type system `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
1919
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5
2020
|
2121
LL | const BAR: u32 = IMPL_REF_BAR;
2222
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23-
note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
23+
note: ...which requires simplifying constant for the type system `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
2424
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5
2525
|
2626
LL | const BAR: u32 = IMPL_REF_BAR;
2727
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28-
note: ...which requires const-evaluating `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
28+
note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
2929
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5
3030
|
3131
LL | const BAR: u32 = IMPL_REF_BAR;
@@ -36,7 +36,7 @@ note: ...which requires optimizing MIR for `<impl at $DIR/issue-24949-assoc-cons
3636
LL | const BAR: u32 = IMPL_REF_BAR;
3737
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3838
= note: ...which requires normalizing `IMPL_REF_BAR`...
39-
= note: ...which again requires const-evaluating + checking `IMPL_REF_BAR`, completing the cycle
39+
= note: ...which again requires simplifying constant for the type system `IMPL_REF_BAR`, completing the cycle
4040
= note: cycle used when running analysis passes on this crate
4141

4242
error: aborting due to previous error

src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
error[E0391]: cycle detected when const-evaluating + checking `DEFAULT_REF_BAR`
1+
error[E0391]: cycle detected when simplifying constant for the type system `DEFAULT_REF_BAR`
22
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
33
|
44
LL | const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
note: ...which requires const-evaluating + checking `DEFAULT_REF_BAR`...
7+
note: ...which requires simplifying constant for the type system `DEFAULT_REF_BAR`...
88
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
99
|
1010
LL | const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR;
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12-
note: ...which requires const-evaluating `DEFAULT_REF_BAR`...
12+
note: ...which requires const-evaluating + checking `DEFAULT_REF_BAR`...
1313
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
1414
|
1515
LL | const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR;
1616
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1717
= note: ...which requires normalizing `<GlobalDefaultRef as FooDefault>::BAR`...
18-
note: ...which requires const-evaluating + checking `FooDefault::BAR`...
18+
note: ...which requires simplifying constant for the type system `FooDefault::BAR`...
1919
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
2020
|
2121
LL | const BAR: u32 = DEFAULT_REF_BAR;
2222
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23-
note: ...which requires const-evaluating + checking `FooDefault::BAR`...
23+
note: ...which requires simplifying constant for the type system `FooDefault::BAR`...
2424
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
2525
|
2626
LL | const BAR: u32 = DEFAULT_REF_BAR;
2727
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28-
note: ...which requires const-evaluating `FooDefault::BAR`...
28+
note: ...which requires const-evaluating + checking `FooDefault::BAR`...
2929
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
3030
|
3131
LL | const BAR: u32 = DEFAULT_REF_BAR;
@@ -36,7 +36,7 @@ note: ...which requires optimizing MIR for `FooDefault::BAR`...
3636
LL | const BAR: u32 = DEFAULT_REF_BAR;
3737
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3838
= note: ...which requires normalizing `DEFAULT_REF_BAR`...
39-
= note: ...which again requires const-evaluating + checking `DEFAULT_REF_BAR`, completing the cycle
39+
= note: ...which again requires simplifying constant for the type system `DEFAULT_REF_BAR`, completing the cycle
4040
= note: cycle used when running analysis passes on this crate
4141

4242
error: aborting due to previous error

src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
error[E0391]: cycle detected when const-evaluating + checking `TRAIT_REF_BAR`
1+
error[E0391]: cycle detected when simplifying constant for the type system `TRAIT_REF_BAR`
22
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
33
|
44
LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
note: ...which requires const-evaluating + checking `TRAIT_REF_BAR`...
7+
note: ...which requires simplifying constant for the type system `TRAIT_REF_BAR`...
88
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
99
|
1010
LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12-
note: ...which requires const-evaluating `TRAIT_REF_BAR`...
12+
note: ...which requires const-evaluating + checking `TRAIT_REF_BAR`...
1313
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
1414
|
1515
LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
1616
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1717
= note: ...which requires normalizing `<GlobalTraitRef as Foo>::BAR`...
18-
note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`...
18+
note: ...which requires simplifying constant for the type system `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`...
1919
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
2020
|
2121
LL | const BAR: u32 = TRAIT_REF_BAR;
2222
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23-
note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`...
23+
note: ...which requires simplifying constant for the type system `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`...
2424
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
2525
|
2626
LL | const BAR: u32 = TRAIT_REF_BAR;
2727
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28-
note: ...which requires const-evaluating `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`...
28+
note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`...
2929
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
3030
|
3131
LL | const BAR: u32 = TRAIT_REF_BAR;
@@ -36,7 +36,7 @@ note: ...which requires optimizing MIR for `<impl at $DIR/issue-24949-assoc-cons
3636
LL | const BAR: u32 = TRAIT_REF_BAR;
3737
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3838
= note: ...which requires normalizing `TRAIT_REF_BAR`...
39-
= note: ...which again requires const-evaluating + checking `TRAIT_REF_BAR`, completing the cycle
39+
= note: ...which again requires simplifying constant for the type system `TRAIT_REF_BAR`, completing the cycle
4040
= note: cycle used when running analysis passes on this crate
4141

4242
error: aborting due to previous error

src/test/ui/consts/const-eval/const-eval-query-stack.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ LL | let x: &'static i32 = &(1 / 0);
99
= note: `#[deny(const_err)]` on by default
1010

1111
query stack during panic:
12-
#0 [eval_to_allocation_raw] const-evaluating `main::promoted[1]`
13-
#1 [eval_to_const_value] const-evaluating + checking `main::promoted[1]`
14-
#2 [eval_to_const_value] const-evaluating + checking `main::promoted[1]`
12+
#0 [eval_to_allocation_raw] const-evaluating + checking `main::promoted[1]`
13+
#1 [eval_to_const_value] simplifying constant for the type system `main::promoted[1]`
14+
#2 [eval_to_const_value] simplifying constant for the type system `main::promoted[1]`
1515
#3 [normalize_generic_arg_after_erasing_regions] normalizing `main::promoted[1]`
1616
#4 [optimized_mir] optimizing MIR for `main`
1717
#5 [collect_and_partition_mono_items] collect_and_partition_mono_items

0 commit comments

Comments
 (0)