forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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#103542 - scottmcm:invalid-macro-patterns, r…
…=compiler-errors Pinning tests for some `macro_rules!` errors discussed in the lang meeting r? ``@nikomatsakis`` Mind just stamping these, since they were useful for the meeting discussion today?
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Pinning tests for things that don't work to make sure we notice if that changes | ||
|
||
#![crate_type = "lib"] | ||
|
||
macro_rules! octal_with_bad_digit { | ||
( 0o1238 ) => {}; //~ ERROR invalid digit | ||
} | ||
|
||
macro_rules! binary_with_bad_digit { | ||
( 0b012 ) => {}; //~ ERROR invalid digit | ||
} | ||
|
||
// This can't happen for Hex and Decimal as things like `123A` and `0xFFG` | ||
// get treated as unknown *suffixes*, rather than digits. |
14 changes: 14 additions & 0 deletions
14
src/test/ui/macros/macro_rules-unmatchable-literals.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,14 @@ | ||
error: invalid digit for a base 8 literal | ||
--> $DIR/macro_rules-unmatchable-literals.rs:6:12 | ||
| | ||
LL | ( 0o1238 ) => {}; | ||
| ^ | ||
|
||
error: invalid digit for a base 2 literal | ||
--> $DIR/macro_rules-unmatchable-literals.rs:10:11 | ||
| | ||
LL | ( 0b012 ) => {}; | ||
| ^ | ||
|
||
error: aborting due to 2 previous errors | ||
|