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

Add -Z normalize-docs and enable it for compiler docs #79525

Merged
merged 1 commit into from
Dec 1, 2020

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Nov 29, 2020

Works around #79459 by only enabling normalization for the compiler itself (and anyone who opts-in on nightly). Eventually I want to remove this and enable normalization by default, but that's turned out to be really hard.

This uses a command line option instead of a feature gate so it's easier to pass it to all crates at once. Theoretically it's better to use a feature gate instead so that it's easier for people to use on docs.rs, but I'm also not terribly concerned with how easy it to use a temporary hack.

Addresses #77459.

@jyn514 jyn514 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-associated-items Area: Associated items such as associated types and consts. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself labels Nov 29, 2020
@rust-highfive
Copy link
Collaborator

r? @GuillaumeGomez

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 29, 2020
@jyn514
Copy link
Member Author

jyn514 commented Nov 29, 2020

(I'm testing locally that this actually works and generates the correct docs, this probably shouldn't be approved until then.)

@jyn514
Copy link
Member Author

jyn514 commented Nov 29, 2020

Update: it does not work, I think I modified the wrong part of bootstrap.

@jyn514 jyn514 changed the title Add -Z normalize-docs and enable it for compiler docs [WIP] Add -Z normalize-docs and enable it for compiler docs Nov 29, 2020
@jyn514
Copy link
Member Author

jyn514 commented Nov 29, 2020

Ok, it's working now. Not sure if I should add a test that the option is unstable - it uses -Z so I'd assume it's just as unstable as every other option?

@jyn514 jyn514 changed the title [WIP] Add -Z normalize-docs and enable it for compiler docs Add -Z normalize-docs and enable it for compiler docs Nov 29, 2020
@GuillaumeGomez
Copy link
Member

If you have to use -Z unstable, then it's unstable. Also, I'd like to have someone from the @rust-lang/compiler tool to check this PR as well to be sure we didn't forget anything.

@nagisa
Copy link
Member

nagisa commented Nov 29, 2020

None of the -Z options actually require -Zunstable-options. -Z by itself is intended to signal the instability and stable compiler will blanket-reject any and all -Z options. The -Zunstable-options flag exists to enable making non--Z flags (such as --pretty) unstable.

As long as the newly added flag is in the DebuggingOptions section you're good on stability.

@jyn514
Copy link
Member Author

jyn514 commented Nov 30, 2020

@bors r=GuillaumeGomez

We'll finally have compiler docs that look nice 🎉

@bors
Copy link
Contributor

bors commented Nov 30, 2020

📌 Commit 95a6427 has been approved by GuillaumeGomez

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 30, 2020
m-ou-se added a commit to m-ou-se/rust that referenced this pull request Dec 1, 2020
…illaumeGomez

Add -Z normalize-docs and enable it for compiler docs

Works around rust-lang#79459 by only enabling normalization for the compiler itself (and anyone who opts-in on nightly). Eventually I want to remove this and enable normalization by default, but that's turned out to be [really hard](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/How.20do.20I.20normalize.20projection.20types.20to.20a.20single.20type.3F/near/218125195).

This uses a command line option instead of a feature gate so it's easier to pass it to all crates at once. Theoretically it's better to use a feature gate instead so that it's easier for people to use on docs.rs, but I'm also not terribly concerned with how easy it to use a temporary hack.

Addresses rust-lang#77459.
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 1, 2020
Rollup of 11 pull requests

Successful merges:

 - rust-lang#79038 (Change ui test that are run-pass and that do not test the compiler to library tests)
 - rust-lang#79184 (Stop adding '*' at the end of slice and str typenames for MSVC case)
 - rust-lang#79227 (Remove const_fn_feature_flags test)
 - rust-lang#79444 (Move const ip in ui test to unit test)
 - rust-lang#79522 (Validate lint docs separately.)
 - rust-lang#79525 (Add -Z normalize-docs and enable it for compiler docs)
 - rust-lang#79527 (Move intra-doc link tests into a subdirectory)
 - rust-lang#79548 (Show since when a function is const in stdlib)
 - rust-lang#79568 (update Miri)
 - rust-lang#79573 (Update with status for various NetBSD ports.)
 - rust-lang#79583 (Update books)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 99e075f into rust-lang:master Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-associated-items Area: Associated items such as associated types and consts. A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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 this pull request may close these issues.

None yet

7 participants