Skip to content

Commit 1f1185d

Browse files
committed
Specific proc-macro crate type for other test fixture where needed
1 parent 5b9799b commit 1f1185d

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

crates/ide/src/goto_definition.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1244,6 +1244,7 @@ use mac::fn_macro;
12441244
fn_macro$0!();
12451245
12461246
//- /mac.rs crate:mac
1247+
#![crate_type="proc-macro"]
12471248
#[proc_macro]
12481249
fn fn_macro() {}
12491250
//^^^^^^^^

crates/ide/src/references.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -1501,16 +1501,15 @@ fn f() {
15011501
check(
15021502
r#"
15031503
//- proc_macros: identity
1504-
15051504
#[proc_macros::identity]
15061505
fn func$0() {
15071506
func();
15081507
}
15091508
"#,
15101509
expect![[r#"
1511-
func Function FileId(0) 26..51 29..33
1510+
func Function FileId(0) 25..50 28..32
15121511
1513-
FileId(0) 42..46
1512+
FileId(0) 41..45
15141513
"#]],
15151514
)
15161515
}
@@ -1555,11 +1554,12 @@ fn func() {}
15551554
);
15561555
check(
15571556
r#"
1557+
#![crate_type="proc-macro"]
15581558
#[proc_macro_attribute]
15591559
fn func$0() {}
15601560
"#,
15611561
expect![[r#"
1562-
func Attribute FileId(0) 0..36 27..31
1562+
func Attribute FileId(0) 28..64 55..59
15631563
15641564
(no references)
15651565
"#]],
@@ -1604,11 +1604,12 @@ struct Foo;
16041604
);
16051605
check(
16061606
r#"
1607+
#![crate_type="proc-macro"]
16071608
#[proc_macro_derive(Derive, attributes(x))]
16081609
pub fn deri$0ve(_stream: TokenStream) -> TokenStream {}
16091610
"#,
16101611
expect![[r#"
1611-
derive Derive FileId(0) 0..97 51..57
1612+
derive Derive FileId(0) 28..125 79..85
16121613
16131614
(no references)
16141615
"#]],

0 commit comments

Comments
 (0)