diff --git a/src/librustc_trans/trans/consts.rs b/src/librustc_trans/trans/consts.rs index 8e63f2788ed..0cae0ae59ba 100644 --- a/src/librustc_trans/trans/consts.rs +++ b/src/librustc_trans/trans/consts.rs @@ -628,8 +628,8 @@ fn const_expr_unadjusted<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, if iv >= len { // FIXME #3170: report this earlier on in the const-eval // pass. Reporting here is a bit late. - cx.sess().span_err(e.span, - "const index-expr is out of bounds"); + span_err!(cx.sess(), e.span, E0515, + "const index-expr is out of bounds"); C_undef(val_ty(arr).element_type()) } else { const_get_elt(cx, arr, &[iv as c_uint])