-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle
Err
in ast::LitKind::to_token_lit
.
Fixes #100948.
- Loading branch information
1 parent
a1bea15
commit b997af9
Showing
4 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// compile-flags: -Zunpretty=hir | ||
// check-fail | ||
|
||
// In #100948 this caused an ICE with -Zunpretty=hir. | ||
fn main() { | ||
1u; | ||
//~^ ERROR invalid suffix `u` for number literal | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
error: invalid suffix `u` for number literal | ||
--> $DIR/bad-literal.rs:6:5 | ||
| | ||
LL | 1u; | ||
| ^^ invalid suffix `u` | ||
| | ||
= help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.) | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#[prelude_import] | ||
use ::std::prelude::rust_2015::*; | ||
#[macro_use] | ||
extern crate std; | ||
// compile-flags: -Zunpretty=hir | ||
// check-fail | ||
|
||
// In #100948 this caused an ICE with -Zunpretty=hir. | ||
fn main() { | ||
<bad-literal>; | ||
} |