Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_def/src/macro_expansion_tests/mbe/matching.rs')
| -rw-r--r-- | crates/hir_def/src/macro_expansion_tests/mbe/matching.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crates/hir_def/src/macro_expansion_tests/mbe/matching.rs b/crates/hir_def/src/macro_expansion_tests/mbe/matching.rs index b93072d446..517dfb15b6 100644 --- a/crates/hir_def/src/macro_expansion_tests/mbe/matching.rs +++ b/crates/hir_def/src/macro_expansion_tests/mbe/matching.rs @@ -103,3 +103,22 @@ stringify!(; "#]], ); } + +#[test] +fn range_patterns() { + // FIXME: rustc thinks there are three patterns here, not one. + check( + r#" +macro_rules! m { + ($($p:pat)*) => (stringify!($($p |)*);) +} +m!(.. .. ..); +"#, + expect![[r#" +macro_rules! m { + ($($p:pat)*) => (stringify!($($p |)*);) +} +stringify!(.. .. ..|); +"#]], + ); +} |