Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pinning tests for some macro_rules! errors discussed in the lang meeting #103542

Merged
merged 1 commit into from Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/test/ui/macros/macro_rules-unmatchable-literals.rs
@@ -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 src/test/ui/macros/macro_rules-unmatchable-literals.stderr
@@ -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