aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_ty/src/tests')
-rw-r--r--crates/ra_hir_ty/src/tests/macros.rs26
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]
391fn infer_local_inner_macros() {
392 let (db, pos) = TestDB::with_position(
393 r#"
394//- /main.rs crate:main deps:foo
395fn test() {
396 let x = foo::foo!(1);
397 x<|>;
398}
399
400//- /lib.rs crate:foo
401#[macro_export(local_inner_macros)]
402macro_rules! foo {
403 (1) => { bar!() };
404}
405
406#[macro_export]
407macro_rules! bar {
408 () => { 42 }
409}
410
411"#,
412 );
413 assert_eq!("i32", type_at_pos(&db, pos));
414}
415
416#[test]
391fn infer_builtin_macros_line() { 417fn infer_builtin_macros_line() {
392 assert_snapshot!( 418 assert_snapshot!(
393 infer(r#" 419 infer(r#"