Continue evaluating after parsing incorrect binary literal
This commit is contained in:
parent
fc4b54157f
commit
d8610b31ec
5 changed files with 19 additions and 6 deletions
|
|
@ -299,7 +299,7 @@ impl<'a> StringReader<'a> {
|
|||
|
||||
/// Report a lexical error with a given span.
|
||||
fn err_span(&self, sp: Span, m: &str) {
|
||||
self.sess.span_diagnostic.span_err(sp, m)
|
||||
self.sess.span_diagnostic.struct_span_err(sp, m).emit();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
// error-pattern:no valid digits found for number
|
||||
fn log(a: i32, b: i32) {}
|
||||
|
||||
fn main() {
|
||||
let error = 42;
|
||||
log(error, 0b);
|
||||
//~^ ERROR no valid digits found for number
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error: no valid digits found for number
|
||||
--> $DIR/issue-1802-1.rs:3:16
|
||||
--> $DIR/issue-1802-1.rs:5:16
|
||||
|
|
||||
LL | log(error, 0b);
|
||||
| ^^
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
// error-pattern:no valid digits found for number
|
||||
fn log(a: i32, b: i32) {}
|
||||
|
||||
fn main() {
|
||||
let error = 42;
|
||||
log(error, 0b_usize);
|
||||
//~^ ERROR no valid digits found for number
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,15 @@
|
|||
error: no valid digits found for number
|
||||
--> $DIR/issue-1802-2.rs:3:16
|
||||
--> $DIR/issue-1802-2.rs:5:16
|
||||
|
|
||||
LL | log(error, 0b_usize);
|
||||
| ^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-1802-2.rs:5:16
|
||||
|
|
||||
LL | log(error, 0b_usize);
|
||||
| ^^^^^^^^ expected i32, found usize
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue