mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 18:27:37 +00:00
13 lines
318 B
Rust
13 lines
318 B
Rust
//! Verifies that the reserved underscore `_` cannot be used as an `ident` fragment specifier
|
|
//! within a macro pattern, as it leads to a compilation error.
|
|
|
|
macro_rules! identity {
|
|
($i: ident) => {
|
|
$i
|
|
};
|
|
}
|
|
|
|
fn main() {
|
|
let identity!(_) = 10; //~ ERROR no rules expected reserved identifier `_`
|
|
}
|