From fa61f82bf20bfdc6a890aee18d8130906a25d226 Mon Sep 17 00:00:00 2001 From: silenuss Date: Mon, 15 Aug 2016 00:21:13 -0600 Subject: [PATCH] Update compiler error 0030 to use new error format. --- src/librustc_passes/consts.rs | 8 ++++---- src/test/compile-fail/E0030.rs | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/librustc_passes/consts.rs b/src/librustc_passes/consts.rs index 37e42cdea1bf8..52c452c7af933 100644 --- a/src/librustc_passes/consts.rs +++ b/src/librustc_passes/consts.rs @@ -283,10 +283,10 @@ impl<'a, 'tcx, 'v> Visitor<'v> for CheckCrateVisitor<'a, 'tcx> { Ok(Ordering::Less) | Ok(Ordering::Equal) => {} Ok(Ordering::Greater) => { - span_err!(self.tcx.sess, - start.span, - E0030, - "lower range bound must be less than or equal to upper"); + struct_span_err!(self.tcx.sess, start.span, E0030, + "lower range bound must be less than or equal to upper") + .span_label(start.span, &format!("lower bound larger than upper bound")) + .emit(); } Err(ErrorReported) => {} } diff --git a/src/test/compile-fail/E0030.rs b/src/test/compile-fail/E0030.rs index 7f26f6cdb84af..74e827b3379a7 100644 --- a/src/test/compile-fail/E0030.rs +++ b/src/test/compile-fail/E0030.rs @@ -11,6 +11,8 @@ fn main() { match 5u32 { - 1000 ... 5 => {} //~ ERROR E0030 + 1000 ... 5 => {} + //~^ ERROR lower range bound must be less than or equal to upper + //~| NOTE lower bound larger than upper bound } }