Fixed failing tests (missing labels), added automatic error code in create_feature_err() builder
This commit is contained in:
parent
d1f14ee1b0
commit
4c82845b3a
5 changed files with 17 additions and 25 deletions
|
@ -1,6 +1,6 @@
|
|||
// Not in interpret to make sure we do not use private implementation details
|
||||
|
||||
use crate::errors::MaxNumNodesExceeded;
|
||||
use crate::errors::MaxNumNodesInConstErr;
|
||||
use crate::interpret::{
|
||||
intern_const_alloc_recursive, ConstValue, InternKind, InterpCx, InterpResult, MemPlaceMeta,
|
||||
Scalar,
|
||||
|
@ -77,7 +77,7 @@ pub(crate) fn eval_to_valtree<'tcx>(
|
|||
ValTreeCreationError::NodesOverflow => {
|
||||
let msg = format!("maximum number of nodes exceeded in constant {}", &s);
|
||||
let mut diag = match tcx.hir().span_if_local(did) {
|
||||
Some(span) => tcx.sess.create_err(MaxNumNodesExceeded { span, s }),
|
||||
Some(span) => tcx.sess.create_err(MaxNumNodesInConstErr { span, s }),
|
||||
None => tcx.sess.struct_err(&msg),
|
||||
};
|
||||
diag.emit();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue