rust/tests/ui/macros/auxiliary/metavar_2018.rs
Eric Holk 7653811ac5
Add coverage for pat too
In 2021 pat was changed to recognize `|` at the top level, with
pat_param added to retain the old behavior. This means
pat is subject to the same cross-edition behavior as expr will be in
2024.

Co-authored-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2024-09-17 11:08:52 -07:00

15 lines
391 B
Rust

//@ edition: 2018
#[macro_export]
macro_rules! make_matcher {
($name:ident, $fragment_type:ident, $d:tt) => {
#[macro_export]
macro_rules! $name {
($d _:$fragment_type) => { true };
(const { 0 }) => { false };
(A | B) => { false };
}
};
}
make_matcher!(is_expr_from_2018, expr, $);
make_matcher!(is_pat_from_2018, pat, $);