From db5e509d65600271af7144965a7c88e84e7df05a Mon Sep 17 00:00:00 2001 From: Pete Kubiak Date: Thu, 24 Oct 2024 14:22:39 +0100 Subject: [PATCH] Reinstate proc_macro_diagnostics if built with nightly --- ector/build.rs | 5 +++++ macros/Cargo.toml | 1 + macros/src/lib.rs | 2 ++ 3 files changed, 8 insertions(+) create mode 100644 ector/build.rs diff --git a/ector/build.rs b/ector/build.rs new file mode 100644 index 0000000..dc2fee5 --- /dev/null +++ b/ector/build.rs @@ -0,0 +1,5 @@ +fn main() { + if std::env::var_os("CARGO_FEATURE_NIGHTLY").is_some() { + println!("cargo:rustc-cfg=nightly"); + } +} diff --git a/macros/Cargo.toml b/macros/Cargo.toml index 0b76ed8..b954d11 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -22,3 +22,4 @@ proc-macro2 = "1.0" [features] std = [] +nightly = [] diff --git a/macros/src/lib.rs b/macros/src/lib.rs index fb4c74c..45aaceb 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -1,4 +1,6 @@ #![allow(incomplete_features)] +#![cfg(feature = "nightly")] +#![feature(proc_macro_diagnostic)] extern crate proc_macro; mod actor;