aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty
diff options
context:
space:
mode:
authorBenjamin Coenen <[email protected]>2020-05-02 12:39:05 +0100
committerBenjamin Coenen <[email protected]>2020-05-02 12:39:05 +0100
commitfdf86637bf8338ad19923442a547c6c7b495100c (patch)
treee1d0e28680bb805d34b1d8a56d6f4c7119177fc8 /crates/ra_hir_ty
parent6d5f3922f7cf6d6c02521ad947abd63ab4764fca (diff)
parentfb8fb65131c8d3e6335efd401e4e83287be49357 (diff)
Merge branch 'master' of github.com:rust-analyzer/rust-analyzer
Diffstat (limited to 'crates/ra_hir_ty')
-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 1f796876d..29e38a06c 100644
--- a/crates/ra_hir_ty/src/tests/macros.rs
+++ b/crates/ra_hir_ty/src/tests/macros.rs
@@ -428,6 +428,32 @@ fn main() {
428} 428}
429 429
430#[test] 430#[test]
431fn infer_local_inner_macros() {
432 let (db, pos) = TestDB::with_position(
433 r#"
434//- /main.rs crate:main deps:foo
435fn test() {
436 let x = foo::foo!(1);
437 x<|>;
438}
439
440//- /lib.rs crate:foo
441#[macro_export(local_inner_macros)]
442macro_rules! foo {
443 (1) => { bar!() };
444}
445
446#[macro_export]
447macro_rules! bar {
448 () => { 42 }
449}
450
451"#,
452 );
453 assert_eq!("i32", type_at_pos(&db, pos));
454}
455
456#[test]
431fn infer_builtin_macros_line() { 457fn infer_builtin_macros_line() {
432 assert_snapshot!( 458 assert_snapshot!(
433 infer(r#" 459 infer(r#"