Add new error code
This commit is contained in:
parent
a63b0f045d
commit
8fee5480c3
1 changed files with 2 additions and 2 deletions
|
@ -628,8 +628,8 @@ fn const_expr_unadjusted<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
|
||||||
if iv >= len {
|
if iv >= len {
|
||||||
// FIXME #3170: report this earlier on in the const-eval
|
// FIXME #3170: report this earlier on in the const-eval
|
||||||
// pass. Reporting here is a bit late.
|
// pass. Reporting here is a bit late.
|
||||||
cx.sess().span_err(e.span,
|
span_err!(cx.sess(), e.span, E0515,
|
||||||
"const index-expr is out of bounds");
|
"const index-expr is out of bounds");
|
||||||
C_undef(val_ty(arr).element_type())
|
C_undef(val_ty(arr).element_type())
|
||||||
} else {
|
} else {
|
||||||
const_get_elt(cx, arr, &[iv as c_uint])
|
const_get_elt(cx, arr, &[iv as c_uint])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue