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)),
|
Ok(valtree) => Ok(Some(valtree)),
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
let did = cid.instance.def_id();
|
let did = cid.instance.def_id();
|
||||||
let s = cid.display(tcx);
|
let global_const_id = cid.display(tcx);
|
||||||
match err {
|
match err {
|
||||||
ValTreeCreationError::NodesOverflow => {
|
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) {
|
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),
|
None => tcx.sess.struct_err(&msg),
|
||||||
};
|
};
|
||||||
diag.emit();
|
diag.emit();
|
||||||
|
@ -93,7 +93,7 @@ pub(crate) struct TransientMutBorrowErrRaw {
|
|||||||
pub(crate) struct MaxNumNodesInConstErr {
|
pub(crate) struct MaxNumNodesInConstErr {
|
||||||
#[primary_span]
|
#[primary_span]
|
||||||
pub span: Span,
|
pub span: Span,
|
||||||
pub s: String,
|
pub global_const_id: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(SessionDiagnostic)]
|
#[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_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
|
const_eval_unallowed_fn_pointer_call = function pointer calls are not allowed in {$kind}s
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user