From 95490ff56eb274f8dea58c79a2d33e4f2713d8c8 Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Tue, 14 Jul 2020 14:06:01 -0400 Subject: [PATCH] Apply #![feature(proc_macro_hygiene)] when needed This allows the rust-bpf-builder toolchain to build the sdk --- sdk/build.rs | 5 +++++ sdk/src/lib.rs | 1 + 2 files changed, 6 insertions(+) diff --git a/sdk/build.rs b/sdk/build.rs index e17ca70cb4..c9550c1c5c 100644 --- a/sdk/build.rs +++ b/sdk/build.rs @@ -17,6 +17,11 @@ fn main() { } Channel::Dev => { println!("cargo:rustc-cfg=RUSTC_WITH_SPECIALIZATION"); + // See https://github.com/solana-labs/solana/issues/11055 + // We may be running the custom `rust-bpf-builder` toolchain, + // which currently needs `#![feature(proc_macro_hygiene)]` to + // be applied. + println!("cargo:rustc-cfg=RUSTC_NEEDS_PROC_MACRO_HYGIENE"); } } } diff --git a/sdk/src/lib.rs b/sdk/src/lib.rs index 0268e705ce..12fbe3909a 100644 --- a/sdk/src/lib.rs +++ b/sdk/src/lib.rs @@ -1,4 +1,5 @@ #![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(specialization))] +#![cfg_attr(RUSTC_NEEDS_PROC_MACRO_HYGIENE, feature(proc_macro_hygiene))] // Allows macro expansion of `use ::solana_sdk::*` to work within this crate extern crate self as solana_sdk;