Addressing last comment on PR review
This commit is contained in:
parent
13abae2deb
commit
649749c7b0
3 changed files with 5 additions and 5 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue