Skip to content

Commit 8fee548

Browse files
Add new error code
1 parent a63b0f0 commit 8fee548

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_trans/trans/consts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,8 @@ fn const_expr_unadjusted<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
628628
if iv >= len {
629629
// FIXME #3170: report this earlier on in the const-eval
630630
// pass. Reporting here is a bit late.
631-
cx.sess().span_err(e.span,
632-
"const index-expr is out of bounds");
631+
span_err!(cx.sess(), e.span, E0515,
632+
"const index-expr is out of bounds");
633633
C_undef(val_ty(arr).element_type())
634634
} else {
635635
const_get_elt(cx, arr, &[iv as c_uint])

0 commit comments

Comments
 (0)