]> git.lizzy.rs Git - rust.git/commitdiff
Add regression test
authorEdwin Cheng <edwin0cheng@gmail.com>
Tue, 15 Dec 2020 06:39:26 +0000 (14:39 +0800)
committerEdwin Cheng <edwin0cheng@gmail.com>
Tue, 15 Dec 2020 07:24:35 +0000 (15:24 +0800)
crates/hir_ty/src/tests/regression.rs

index da817041704a32ca364c1067c9b34d41914df8eb..307a257b177098e8637854c8e325e3e128345328 100644 (file)
@@ -592,6 +592,30 @@ fn main() {
     );
 }
 
+#[test]
+fn issue_6811() {
+    check_infer(
+        r#"
+        macro_rules! profile_function {
+            () => {
+                let _a = 1;
+                let _b = 1;
+            };
+        }
+        fn main() {
+            profile_function!();
+        }
+        "#,
+        expect![[r#"
+            !3..5 '_a': i32
+            !6..7 '1': i32
+            !11..13 '_b': i32
+            !14..15 '1': i32
+            103..131 '{     ...!(); }': ()
+        "#]],
+    );
+}
+
 #[test]
 fn issue_4053_diesel_where_clauses() {
     check_infer(