An identifier fragment specifier, written as $name:ident, lets a macro match an identifier such as a variable or function name. The matched name can then be reused in the generated Rust code. section 22.2
Comparing a name with an expression
A macro can accept an identifier and an expression separately: check!(x, 6) matches x as $input1:ident and 6 as $input2:expr. The same pattern also accepts my_vec as the identifier and vec![7, 8, 9] as the expression.

