Skip to content

Commit 703fb66

Browse files
authored
Rollup merge of #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?
2 parents d159124 + 5064648 commit 703fb66

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Pinning tests for things that don't work to make sure we notice if that changes
2+
3+
#![crate_type = "lib"]
4+
5+
macro_rules! octal_with_bad_digit {
6+
( 0o1238 ) => {}; //~ ERROR invalid digit
7+
}
8+
9+
macro_rules! binary_with_bad_digit {
10+
( 0b012 ) => {}; //~ ERROR invalid digit
11+
}
12+
13+
// This can't happen for Hex and Decimal as things like `123A` and `0xFFG`
14+
// get treated as unknown *suffixes*, rather than digits.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: invalid digit for a base 8 literal
2+
--> $DIR/macro_rules-unmatchable-literals.rs:6:12
3+
|
4+
LL | ( 0o1238 ) => {};
5+
| ^
6+
7+
error: invalid digit for a base 2 literal
8+
--> $DIR/macro_rules-unmatchable-literals.rs:10:11
9+
|
10+
LL | ( 0b012 ) => {};
11+
| ^
12+
13+
error: aborting due to 2 previous errors
14+

0 commit comments

Comments
 (0)