Skip to content

Commit 649749c

Browse files
committed
Addressing last comment on PR review
1 parent 13abae2 commit 649749c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

compiler/rustc_const_eval/src/const_eval/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ pub(crate) fn eval_to_valtree<'tcx>(
7272
Ok(valtree) => Ok(Some(valtree)),
7373
Err(err) => {
7474
let did = cid.instance.def_id();
75-
let s = cid.display(tcx);
75+
let global_const_id = cid.display(tcx);
7676
match err {
7777
ValTreeCreationError::NodesOverflow => {
78-
let msg = format!("maximum number of nodes exceeded in constant {}", &s);
78+
let msg = format!("maximum number of nodes exceeded in constant {}", &global_const_id);
7979
let mut diag = match tcx.hir().span_if_local(did) {
80-
Some(span) => tcx.sess.create_err(MaxNumNodesInConstErr { span, s }),
80+
Some(span) => tcx.sess.create_err(MaxNumNodesInConstErr { span, global_const_id }),
8181
None => tcx.sess.struct_err(&msg),
8282
};
8383
diag.emit();

compiler/rustc_const_eval/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub(crate) struct TransientMutBorrowErrRaw {
9393
pub(crate) struct MaxNumNodesInConstErr {
9494
#[primary_span]
9595
pub span: Span,
96-
pub s: String,
96+
pub global_const_id: String,
9797
}
9898

9999
#[derive(SessionDiagnostic)]

compiler/rustc_error_messages/locales/en-US/const_eval.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const_eval_transient_mut_borrow = mutable references are not allowed in {$kind}s
3030
3131
const_eval_transient_mut_borrow_raw = raw mutable references are not allowed in {$kind}s
3232
33-
const_eval_max_num_nodes_in_const = maximum number of nodes exceeded in constant {$s}
33+
const_eval_max_num_nodes_in_const = maximum number of nodes exceeded in constant {$global_const_id}
3434
3535
const_eval_unallowed_fn_pointer_call = function pointer calls are not allowed in {$kind}s
3636

0 commit comments

Comments
 (0)