Skip to content

Commit 13510ac

Browse files
committed
Auto merge of #3064 - rust-lang:rustup-2023-09-19, r=RalfJung
Automatic sync from rustc
2 parents 6ea8639 + 7e1fedb commit 13510ac

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ae9465fee3962c0c895959001302999bc48ba6d5
1+
19dd9535408db0f1ff3d16613619076aef524d19

src/helpers.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
142142
fn eval_path_scalar(&self, path: &[&str]) -> Scalar<Provenance> {
143143
let this = self.eval_context_ref();
144144
let instance = this.resolve_path(path, Namespace::ValueNS);
145-
let cid = GlobalId { instance, promoted: None };
146145
// We don't give a span -- this isn't actually used directly by the program anyway.
147-
let const_val = this.eval_global(cid, None).unwrap_or_else(|err| {
146+
let const_val = this.eval_global(instance).unwrap_or_else(|err| {
148147
panic!("failed to evaluate required Rust item: {path:?}\n{err:?}")
149148
});
150149
this.read_scalar(&const_val)

tests/fail/const-ub-checks.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0080]: evaluation of constant value failed
44
LL | ptr.read();
55
| ^^^^^^^^^^ accessing memory with alignment ALIGN, but alignment ALIGN is required
66

7-
note: erroneous constant used
7+
note: erroneous constant encountered
88
--> $DIR/const-ub-checks.rs:LL:CC
99
|
1010
LL | let _x = UNALIGNED_READ;

tests/fail/erroneous_const.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | const VOID: ! = panic!();
66
|
77
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
88

9-
note: erroneous constant used
9+
note: erroneous constant encountered
1010
--> $DIR/erroneous_const.rs:LL:CC
1111
|
1212
LL | let _ = PrintName::<T>::VOID;

tests/fail/erroneous_const2.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ error[E0080]: evaluation of constant value failed
44
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
55
| ^^^^^ attempt to compute `5_u32 - 6_u32`, which would overflow
66

7-
note: erroneous constant used
7+
note: erroneous constant encountered
88
--> $DIR/erroneous_const2.rs:LL:CC
99
|
1010
LL | println!("{}", FOO);
1111
| ^^^
1212

13-
note: erroneous constant used
13+
note: erroneous constant encountered
1414
--> $DIR/erroneous_const2.rs:LL:CC
1515
|
1616
LL | println!("{}", FOO);

0 commit comments

Comments
 (0)