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
Make proc_macro_span
optional with nightly
#415
Comments
I suspect this is a Cargo bug. Cargo is not propagating that I tested this by creating a 2-line .cargo/config.toml as you showed, and a build script containing: // build.rs
fn main() {
std::process::Command::new("env").status().unwrap();
std::process::exit(1);
} The output of |
Indeed, it looks like the flag is not passed when using
I am not very sure if I should open an issue in cargo though, as it might be expected based on this 🤷♀️ rust-lang/cargo#12437 (comment). Out of curiosity, what is the reasoning for always enabling |
I belive I'm having the same issue. Recently when trying to build any crate on nightly, I'm always getting errors from proc-macro2.
This forces me to use stable as I don't know how to fix this. |
@tqwewe You are required to also update the crate to the latest version, so, cargo update -p proc-macro2 --precise 1.0.81 as proc-macro2 enables nightly features implicitly to save you the inconvenience of having to think about and enable a feature on your own. This also means that each version of this software is neither forward nor backward compatible if anything changes even slightly about versioning or build flags or etc. |
From the documentation of
proc_macro_span
I was understanding that if you don't allow unstable features in your nightly build, then the build of the crate should still work:"Enabled when building with nightly, unless
-Z allow-feature
in RUSTFLAGS disallows unstable features."I am using the following configuration in my
.cargo/config.toml
:And the following rust nightly:
nightly-2023-09-25
.When building a dummy crate that just has proc-macro2 as a dependency, the following happens:
The
--cfg proc_macro_span
was added even though we also pass the-Zallow-features=
flag. Is this the expected behavior?I would like to be able to build proc-macro2 with nightly without having to enable the unstable feature. Is this possible?
The text was updated successfully, but these errors were encountered: