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

Provide way to disable nightly cfg #175

Closed
Nemo157 opened this issue Apr 27, 2019 · 2 comments · Fixed by #176
Closed

Provide way to disable nightly cfg #175

Nemo157 opened this issue Apr 27, 2019 · 2 comments · Fixed by #176

Comments

@Nemo157
Copy link
Contributor

Nemo157 commented Apr 27, 2019

In futures we're attempting to treat the nightly compiler as stable using RUSTFLAGS="-Z allow-features=" to ensure future compatibility with Rust 1.36. Unfortunately this is failing in CI because of proc-macro2 unconditionally activating its own nightly cfg and attempting to use an unstable feature.

It would be great if we could somehow disable this feature no matter what channel of Rust we happen to be building with.

Nemo157 added a commit to Nemo157/futures-rs that referenced this issue Apr 27, 2019
Nemo157 added a commit to Nemo157/futures-rs that referenced this issue Apr 27, 2019
Nemo157 added a commit to rust-lang/futures-rs that referenced this issue Apr 27, 2019
@dtolnay
Copy link
Owner

dtolnay commented Apr 27, 2019

I would accept a PR to parse RUSTFLAGS in our build script and look for whether proc_macro_span is present in allow-features.

If that won't work, alternatively we could expose an opt-out through RUSTFLAGS:

RUSTFLAGS='--cfg no_opportunistic_nightly'

@Nemo157
Copy link
Contributor Author

Nemo157 commented Apr 27, 2019

Parsing RUSTFLAGS sounds reasonable if the build script has access to it, I’ll take a look at doing that tomorrow.

bors bot added a commit to taiki-e/pin-project that referenced this issue Aug 29, 2019
54: Detect if the proc_macro_def_site feature is not disallowed by -Zallow-features r=taiki-e a=taiki-e

Apart from what I mentioned in #53 (comment), there are cases where you want to completely avoid using the nightly function in the first place.

Refs: dtolnay/proc-macro2#175

Co-authored-by: Taiki Endo <te316e89@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants