Skip to content

Commit

Permalink
Fix hygiene in various macros (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton authored Nov 21, 2017
1 parent 1ebcabf commit 4c53e76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion stdsimd-test/assert-instr-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ pub fn assert_instr(
)
};

let tts: TokenStream = quote! {
let tts: TokenStream = quote_spanned! {
proc_macro2::Span::call_site(),
#[test]
#[allow(non_snake_case)]
#maybe_ignore
Expand Down
6 changes: 4 additions & 2 deletions stdsimd-test/simd-test-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,17 @@ pub fn simd_test(
let mut cfg_target_features = quote::Tokens::new();
use quote::ToTokens;
for feature in target_features {
let q = quote! {
let q = quote_spanned! {
proc_macro2::Span::call_site(),
cfg_feature_enabled!(#feature) &&
};
q.to_tokens(&mut cfg_target_features);
}
let q = quote!{ true };
q.to_tokens(&mut cfg_target_features);

let ret: TokenStream = quote! {
let ret: TokenStream = quote_spanned! {
proc_macro2::Span::call_site(),
#[allow(non_snake_case)]
#[test]
fn #name() {
Expand Down

0 comments on commit 4c53e76

Please sign in to comment.