mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Addressing last comment on PR review
This commit is contained in:
parent
13abae2deb
commit
649749c7b0
@ -72,12 +72,12 @@ pub(crate) fn eval_to_valtree<'tcx>(
|
||||
Ok(valtree) => Ok(Some(valtree)),
|
||||
Err(err) => {
|
||||
let did = cid.instance.def_id();
|
||||
let s = cid.display(tcx);
|
||||
let global_const_id = cid.display(tcx);
|
||||
match err {
|
||||
ValTreeCreationError::NodesOverflow => {
|
||||
let msg = format!("maximum number of nodes exceeded in constant {}", &s);
|
||||
let msg = format!("maximum number of nodes exceeded in constant {}", &global_const_id);
|
||||
let mut diag = match tcx.hir().span_if_local(did) {
|
||||
Some(span) => tcx.sess.create_err(MaxNumNodesInConstErr { span, s }),
|
||||
Some(span) => tcx.sess.create_err(MaxNumNodesInConstErr { span, global_const_id }),
|
||||
None => tcx.sess.struct_err(&msg),
|
||||
};
|
||||
diag.emit();
|
||||
|
@ -93,7 +93,7 @@ pub(crate) struct TransientMutBorrowErrRaw {
|
||||
pub(crate) struct MaxNumNodesInConstErr {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub s: String,
|
||||
pub global_const_id: String,
|
||||
}
|
||||
|
||||
#[derive(SessionDiagnostic)]
|
||||
|
@ -30,7 +30,7 @@ const_eval_transient_mut_borrow = mutable references are not allowed in {$kind}s
|
||||
|
||||
const_eval_transient_mut_borrow_raw = raw mutable references are not allowed in {$kind}s
|
||||
|
||||
const_eval_max_num_nodes_in_const = maximum number of nodes exceeded in constant {$s}
|
||||
const_eval_max_num_nodes_in_const = maximum number of nodes exceeded in constant {$global_const_id}
|
||||
|
||||
const_eval_unallowed_fn_pointer_call = function pointer calls are not allowed in {$kind}s
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user