Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hygiene in various macros #204

Merged
merged 1 commit into from
Nov 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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