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

rustdoc does not verify feature gates #67647

Closed
Mark-Simulacrum opened this issue Dec 26, 2019 · 7 comments · Fixed by #67989
Closed

rustdoc does not verify feature gates #67647

Mark-Simulacrum opened this issue Dec 26, 2019 · 7 comments · Fixed by #67989
Labels
A-stability Area: `#[stable]`, `#[unstable]` etc. C-bug Category: This is a bug. P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Mark-Simulacrum
Copy link
Member

This generates documentation with a stable rustdoc today without any warnings.

#![feature(raw)]

use std::raw::TraitObject;

pub fn bar() {}

Interestingly, rustdoc does seem to check that the feature gate is in the crate (i.e., #![feature(raw)] must exist), and will error if a feature gate has been removed (e.g., custom_attribute on nightly).

@Mark-Simulacrum Mark-Simulacrum added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 26, 2019
@Mark-Simulacrum
Copy link
Member Author

cc @GuillaumeGomez @rust-lang/rustdoc

@kinnison
Copy link
Contributor

I'd guess this is related to https://github.com/rust-lang/rust/blob/master/src/librustdoc/core.rs#L318 somehow. I'm not entirely sure what rustdoc relies on which would mandate the locking in of the permission to use unstable features, but perhaps @GuillaumeGomez would know?

@GuillaumeGomez
Copy link
Member

Normally, for such things rustdoc relies on rustc internals to do the work. Maybe an option is badly set?

@jonas-schievink jonas-schievink added A-stability Area: `#[stable]`, `#[unstable]` etc. C-bug Category: This is a bug. labels Jan 1, 2020
@pnkfelix
Copy link
Member

pnkfelix commented Jan 2, 2020

triage: looks like this should be T-rustdoc's call as to what priority to assign here. Leaving unprioritized and nominated, at least for a week.

@GuillaumeGomez GuillaumeGomez added the P-medium Medium priority label Jan 3, 2020
@GuillaumeGomez
Copy link
Member

I made the priority medium: it's not a huge bug but the quicker it's fixed, the better it'll be for everyone.

@ollie27
Copy link
Member

ollie27 commented Jan 7, 2020

#67989 should fix this.

@Mark-Simulacrum
Copy link
Member Author

@ollie27 Thanks! I've also gone ahead and nominated it for beta backport as it's probably good to close the stability hole sooner rather than later; it's a trivial patch.

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Jan 13, 2020
…meGomez

rustdoc: Don't allow `#![feature(...)]` on stable or beta

Fixes rust-lang#67647

r? @GuillaumeGomez
@bors bors closed this as completed in 9e47ddd Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stability Area: `#[stable]`, `#[unstable]` etc. C-bug Category: This is a bug. P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants