Skip to content

autogenerate compiler flag stubs in the unstable book #141525

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

Open
jyn514 opened this issue May 24, 2025 · 1 comment · May be fixed by #142135
Open

autogenerate compiler flag stubs in the unstable book #141525

jyn514 opened this issue May 24, 2025 · 1 comment · May be fixed by #142135
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools E-help-wanted Call for participation: Help is requested to fix this issue. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. 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.

Comments

@jyn514
Copy link
Member

jyn514 commented May 24, 2025

Location

https://doc.rust-lang.org/nightly/unstable-book/compiler-flags.html

Summary

currently, we autogenerate stubs for lang and libs features (e.g. https://doc.rust-lang.org/nightly/unstable-book/language-features/explicit-tail-calls.html and https://doc.rust-lang.org/nightly/unstable-book/library-features/windows-process-extensions-force-quotes.html). but we don't do the same for rustc. it would be nice if we did, using -Z help.

this will be non-trivial to implement because it requires bootstrap changes so that rustc is built before unstable-book-gen.

@jyn514 jyn514 added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label May 24, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 24, 2025
@Noratrieb Noratrieb added 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) and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels May 25, 2025
@jyn514
Copy link
Member Author

jyn514 commented May 27, 2025

currently all the collect_features functions live in tidy. that doesn't work here, because we don't want to require building the compiler before building tidy.

mentoring instructions:

  • change
    fn run(self, builder: &Builder<'_>) {
    let target = self.target;
    builder.info(&format!("Generating unstable book md files ({target})"));
    let out = builder.md_doc_out(target).join("unstable-book");
    builder.create_dir(&out);
    builder.remove_dir(&out);
    let mut cmd = builder.tool_cmd(Tool::UnstableBookGen);
    cmd.arg(builder.src.join("library"));
    cmd.arg(builder.src.join("compiler"));
    cmd.arg(builder.src.join("src"));
    cmd.arg(out);
    cmd.run(builder);
    }
    to build a rustc for unstable-book-gen
  • extend
    let unstable_lang_features = collect_unstable_feature_names(&lang_features);
    let unstable_lib_features = collect_unstable_feature_names(&lib_features);
    to also run rustc -Zhelp and parse the output. then use that to generate stubs, by the same logic as the existing library and lang features.

@rustbot label E-medium E-help-wanted

@rustbot rustbot added E-help-wanted Call for participation: Help is requested to fix this issue. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. labels May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools E-help-wanted Call for participation: Help is requested to fix this issue. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. 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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants