aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2020-03-14 06:25:30 +0000
committerEdwin Cheng <[email protected]>2020-03-14 06:25:51 +0000
commitfe78a14bbb9769c8ccd5cc41415702f5176a8e88 (patch)
tree2ec165fbab4bba4d379d5b1936168456dab4585f /crates/ra_hir_ty
parent4c85e53531fc9e2e2c2f1368c01e08e10e190cd5 (diff)
Support local macro_rules
Diffstat (limited to 'crates/ra_hir_ty')
-rw-r--r--crates/ra_hir_ty/src/tests/macros.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/tests/macros.rs b/crates/ra_hir_ty/src/tests/macros.rs
index 32457bbf7..3b7022ad5 100644
--- a/crates/ra_hir_ty/src/tests/macros.rs
+++ b/crates/ra_hir_ty/src/tests/macros.rs
@@ -363,6 +363,26 @@ fn main() {
363} 363}
364 364
365#[test] 365#[test]
366fn infer_local_macro() {
367 assert_snapshot!(
368 infer(r#"
369fn main() {
370 macro_rules! foo {
371 () => { 1usize }
372 }
373 let _a = foo!();
374}
375"#),
376 @r###"
377 ![0; 6) '1usize': usize
378 [11; 90) '{ ...!(); }': ()
379 [17; 66) 'macro_... }': {unknown}
380 [75; 77) '_a': usize
381 "###
382 );
383}
384
385#[test]
366fn infer_builtin_macros_line() { 386fn infer_builtin_macros_line() {
367 assert_snapshot!( 387 assert_snapshot!(
368 infer(r#" 388 infer(r#"