Skip to content

Commit 7ec253f

Browse files
author
Jonathan Turner
authored
Rollup merge of rust-lang#35415 - silenuss:e0030-formatting, r=jonathandturner
Update compiler error 0030 to use new error format. Part of rust-lang#35233, Addresses rust-lang#35204 r? @jonathandturner
2 parents 5c940b1 + fa61f82 commit 7ec253f

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/librustc_passes/consts.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,10 @@ impl<'a, 'tcx, 'v> Visitor<'v> for CheckCrateVisitor<'a, 'tcx> {
283283
Ok(Ordering::Less) |
284284
Ok(Ordering::Equal) => {}
285285
Ok(Ordering::Greater) => {
286-
span_err!(self.tcx.sess,
287-
start.span,
288-
E0030,
289-
"lower range bound must be less than or equal to upper");
286+
struct_span_err!(self.tcx.sess, start.span, E0030,
287+
"lower range bound must be less than or equal to upper")
288+
.span_label(start.span, &format!("lower bound larger than upper bound"))
289+
.emit();
290290
}
291291
Err(ErrorReported) => {}
292292
}

src/test/compile-fail/E0030.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
fn main() {
1313
match 5u32 {
14-
1000 ... 5 => {} //~ ERROR E0030
14+
1000 ... 5 => {}
15+
//~^ ERROR lower range bound must be less than or equal to upper
16+
//~| NOTE lower bound larger than upper bound
1517
}
1618
}

0 commit comments

Comments
 (0)