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 | 27 |
1 files changed, 26 insertions, 1 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 e9a977da91..e33a366769 100644 --- a/crates/hir-def/src/macro_expansion_tests/mbe/matching.rs +++ b/crates/hir-def/src/macro_expansion_tests/mbe/matching.rs @@ -162,9 +162,10 @@ fn test() { } #[test] -fn expr_dont_match_inline_const() { +fn expr_inline_const() { check( r#" +//- /lib.rs edition:2021 macro_rules! foo { ($e:expr) => { $e } } @@ -183,6 +184,30 @@ fn test() { } "#]], ); + check( + r#" +//- /lib.rs edition:2024 +macro_rules! foo { + ($e:expr) => { $e } +} + +fn test() { + foo!(const { 3 }); +} +"#, + expect![[r#" +macro_rules! foo { + ($e:expr) => { $e } +} + +fn test() { + (const { + 3 + } + ); +} +"#]], + ); } #[test] |