Skip to content

Commit

Permalink
Rollup merge of rust-lang#35415 - silenuss:e0030-formatting, r=jonath…
Browse files Browse the repository at this point in the history
…andturner

Update compiler error 0030 to use new error format.

Part of rust-lang#35233,
Addresses rust-lang#35204

r? @jonathandturner
  • Loading branch information
Jonathan Turner authored Aug 17, 2016
2 parents e83bff9 + fa61f82 commit d3f55e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/librustc_passes/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {}
}
Expand Down
4 changes: 3 additions & 1 deletion src/test/compile-fail/E0030.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

0 comments on commit d3f55e1

Please sign in to comment.