Skip to content

cfg_accessible does not respect feature gating #72011

New issue

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

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

Already on GitHub? # to your account

Open
Nemo157 opened this issue May 8, 2020 · 2 comments
Open

cfg_accessible does not respect feature gating #72011

Nemo157 opened this issue May 8, 2020 · 2 comments
Labels
F-cfg_accessible `#![feature(cfg_accessible)]` requires-nightly This issue requires a nightly compiler in some way. T-lang Relevant to the language team

Comments

@Nemo157
Copy link
Member

Nemo157 commented May 8, 2020

(Since cfg(version)'s support for nightly is under discussion, I decided to check how cfg(accessible)'s support was going. I realise it is far from done, but since it's possible to write a testcase for this now I thought it would be worth having an issue to make sure it's not forgotten.)

#![feature(cfg_accessible)]

#[cfg_accessible(std::fmt::rt::v1)]
const _: () = { use std::fmt::rt::v1; };

This code (playground) should cleanly compile as std::fmt::rt::v1 is gated behind the inactive fmt_internals feature, and cfg(accessible) should ignore disabled gated features. Instead it errors out:

error[E0658]: use of unstable library feature 'fmt_internals': internal to format_args!

cc #64797

@Nemo157
Copy link
Member Author

Nemo157 commented May 8, 2020

@rustbot modify labels to F-cfg_accessible, T-lang, B-unstable

@rustbot rustbot added B-unstable Blocker: Implemented in the nightly compiler and unstable. F-cfg_accessible `#![feature(cfg_accessible)]` T-lang Relevant to the language team labels May 8, 2020
@Nemo157
Copy link
Member Author

Nemo157 commented May 8, 2020

@rustbot modify labels: +requires-nightly, -B-unstable

@rustbot rustbot added requires-nightly This issue requires a nightly compiler in some way. and removed B-unstable Blocker: Implemented in the nightly compiler and unstable. labels May 8, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
F-cfg_accessible `#![feature(cfg_accessible)]` requires-nightly This issue requires a nightly compiler in some way. T-lang Relevant to the language team
Projects
None yet
Development

No branches or pull requests

2 participants