diff options
Diffstat (limited to 'crates/ra_hir_ty/src/tests')
-rw-r--r-- | crates/ra_hir_ty/src/tests/macros.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/tests/macros.rs b/crates/ra_hir_ty/src/tests/macros.rs index 5ddecbdc6..70e17bc94 100644 --- a/crates/ra_hir_ty/src/tests/macros.rs +++ b/crates/ra_hir_ty/src/tests/macros.rs | |||
@@ -388,6 +388,32 @@ fn main() { | |||
388 | } | 388 | } |
389 | 389 | ||
390 | #[test] | 390 | #[test] |
391 | fn infer_local_inner_macros() { | ||
392 | let (db, pos) = TestDB::with_position( | ||
393 | r#" | ||
394 | //- /main.rs crate:main deps:foo | ||
395 | fn test() { | ||
396 | let x = foo::foo!(1); | ||
397 | x<|>; | ||
398 | } | ||
399 | |||
400 | //- /lib.rs crate:foo | ||
401 | #[macro_export(local_inner_macros)] | ||
402 | macro_rules! foo { | ||
403 | (1) => { bar!() }; | ||
404 | } | ||
405 | |||
406 | #[macro_export] | ||
407 | macro_rules! bar { | ||
408 | () => { 42 } | ||
409 | } | ||
410 | |||
411 | "#, | ||
412 | ); | ||
413 | assert_eq!("i32", type_at_pos(&db, pos)); | ||
414 | } | ||
415 | |||
416 | #[test] | ||
391 | fn infer_builtin_macros_line() { | 417 | fn infer_builtin_macros_line() { |
392 | assert_snapshot!( | 418 | assert_snapshot!( |
393 | infer(r#" | 419 | infer(r#" |