Specific proc-macro crate type for other test fixture where needed

This commit is contained in:
Lukas Wirth 2022-03-09 22:18:09 +01:00
parent 5b9799bba4
commit 1f1185dcbb
2 changed files with 7 additions and 5 deletions

View file

@ -1244,6 +1244,7 @@ use mac::fn_macro;
fn_macro$0!(); fn_macro$0!();
//- /mac.rs crate:mac //- /mac.rs crate:mac
#![crate_type="proc-macro"]
#[proc_macro] #[proc_macro]
fn fn_macro() {} fn fn_macro() {}
//^^^^^^^^ //^^^^^^^^

View file

@ -1501,16 +1501,15 @@ fn f() {
check( check(
r#" r#"
//- proc_macros: identity //- proc_macros: identity
#[proc_macros::identity] #[proc_macros::identity]
fn func$0() { fn func$0() {
func(); func();
} }
"#, "#,
expect![[r#" expect![[r#"
func Function FileId(0) 26..51 29..33 func Function FileId(0) 25..50 28..32
FileId(0) 42..46 FileId(0) 41..45
"#]], "#]],
) )
} }
@ -1555,11 +1554,12 @@ fn func() {}
); );
check( check(
r#" r#"
#![crate_type="proc-macro"]
#[proc_macro_attribute] #[proc_macro_attribute]
fn func$0() {} fn func$0() {}
"#, "#,
expect![[r#" expect![[r#"
func Attribute FileId(0) 0..36 27..31 func Attribute FileId(0) 28..64 55..59
(no references) (no references)
"#]], "#]],
@ -1604,11 +1604,12 @@ struct Foo;
); );
check( check(
r#" r#"
#![crate_type="proc-macro"]
#[proc_macro_derive(Derive, attributes(x))] #[proc_macro_derive(Derive, attributes(x))]
pub fn deri$0ve(_stream: TokenStream) -> TokenStream {} pub fn deri$0ve(_stream: TokenStream) -> TokenStream {}
"#, "#,
expect![[r#" expect![[r#"
derive Derive FileId(0) 0..97 51..57 derive Derive FileId(0) 28..125 79..85
(no references) (no references)
"#]], "#]],