forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#105039 - nnethercote:fix-104769, r=petroche…
…nkov Fix an ICE parsing a malformed literal in `concat_bytes!`. Fixes rust-lang#104769. r? `@petrochenkov`
- Loading branch information
Showing
3 changed files
with
29 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
8 changes: 8 additions & 0 deletions
8
src/test/ui/macros/issue-104769-concat_bytes-invalid-literal.rs
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 @@ | ||
#![feature(concat_bytes)] | ||
|
||
fn main() { | ||
concat_bytes!(7Y); | ||
//~^ ERROR invalid suffix `Y` for number literal | ||
concat_bytes!(888888888888888888888888888888888888888); | ||
//~^ ERROR integer literal is too large | ||
} |
16 changes: 16 additions & 0 deletions
16
src/test/ui/macros/issue-104769-concat_bytes-invalid-literal.stderr
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,16 @@ | ||
error: invalid suffix `Y` for number literal | ||
--> $DIR/issue-104769-concat_bytes-invalid-literal.rs:4:19 | ||
| | ||
LL | concat_bytes!(7Y); | ||
| ^^ invalid suffix `Y` | ||
| | ||
= help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.) | ||
|
||
error: integer literal is too large | ||
--> $DIR/issue-104769-concat_bytes-invalid-literal.rs:6:19 | ||
| | ||
LL | concat_bytes!(888888888888888888888888888888888888888); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|