Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/macro_expansion_tests/mbe/regression.rs')
-rw-r--r--crates/hir-def/src/macro_expansion_tests/mbe/regression.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/crates/hir-def/src/macro_expansion_tests/mbe/regression.rs b/crates/hir-def/src/macro_expansion_tests/mbe/regression.rs
index e2022c7967..ddabb50251 100644
--- a/crates/hir-def/src/macro_expansion_tests/mbe/regression.rs
+++ b/crates/hir-def/src/macro_expansion_tests/mbe/regression.rs
@@ -109,6 +109,42 @@ fn main() {
}
#[test]
+fn ty_fragment_followed_by_expr() {
+ check(
+ r#"
+macro_rules! a {
+ ($t:tt) => {};
+}
+
+macro_rules! b {
+ ($t:ty) => {
+ a!($t);
+ };
+}
+
+fn main() {
+ b!(&'static str);
+}
+"#,
+ expect![[r#"
+macro_rules! a {
+ ($t:tt) => {};
+}
+
+macro_rules! b {
+ ($t:ty) => {
+ a!($t);
+ };
+}
+
+fn main() {
+ a!(&'static str);;
+}
+"#]],
+ );
+}
+
+#[test]
fn test_winapi_struct() {
// from https://github.com/retep998/winapi-rs/blob/a7ef2bca086aae76cf6c4ce4c2552988ed9798ad/src/macros.rs#L366