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

Document rustc_macros on nightly-rustc #80362

Merged
merged 1 commit into from
Dec 28, 2020
Merged

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Dec 25, 2020

Fixes #80345.

image
image

r? @ehuss

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 25, 2020
@jyn514 jyn514 added A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself 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. labels Dec 25, 2020
Comment on lines -503 to +513
// This is the intended out directory for compiler documentation.
let out = builder.compiler_doc_out(target);
t!(fs::create_dir_all(&out));

let compiler = builder.compiler(stage, builder.config.build);

if !builder.config.compiler_docs {
builder.info("\tskipping - compiler/librustdoc docs disabled");
return;
}

// This is the intended out directory for compiler documentation.
let out = builder.compiler_doc_out(target);
t!(fs::create_dir_all(&out));

// Build rustc.
let compiler = builder.compiler(stage, builder.config.build);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this was just moved since it's not needed when compiler-docs is off?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, this is just cleanup. I think builder.compiler() won't do any extra work because you'd need it anyway for other docs, but I'm not 100% sure about that.

@ehuss
Copy link
Contributor

ehuss commented Dec 26, 2020

It is a bit of an unfortunate hack, but I think it should be fine considering it is already doing symlink shenanigans. If it is a problem in the future it can always be adjusted.

I don't think rearranging the check for compiler_docs matters. I think the way the docs were generated have evolved where this Step was not always conditional. I think the proper way to conditionally exclude a step is to call default_condition in should_run, if you really want to clean it up (the Rustdoc step should also be updated).

I'm not sure how valuable this is, since the proc-macros don't actually have any documentation.

But despite the above, I don't think this should cause too many problems, and seems to work as expected.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 26, 2020

📌 Commit 82acbc8 has been approved by ehuss

@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 Dec 26, 2020
@camelid
Copy link
Member

camelid commented Dec 27, 2020

I'm not sure how valuable this is, since the proc-macros don't actually have any documentation.

I often use the API docs to look up a path so that I can see the type signatures and find where it's defined in the source code, so it will be helpful to me at least :)

Plus, hopefully we'll document the proc macros at some point.

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 28, 2020
Rollup of 11 pull requests

Successful merges:

 - rust-lang#79662 (Move some more code out of CodegenBackend::{codegen_crate,link})
 - rust-lang#79815 (Update RELEASES.md for 1.49.0)
 - rust-lang#80284 (Suggest fn ptr rather than fn item and suggest to use `Fn` trait bounds rather than the unique closure type in E0121)
 - rust-lang#80331 (Add more comments to trait queries)
 - rust-lang#80344 (use matches!() macro in more places)
 - rust-lang#80353 (BTreeMap: test split_off (and append) more thoroughly)
 - rust-lang#80362 (Document rustc_macros on nightly-rustc)
 - rust-lang#80399 (Remove FIXME in rustc_privacy)
 - rust-lang#80408 (Sync rustc_codegen_cranelift)
 - rust-lang#80411 (rustc_span: Remove `Symbol::with`)
 - rust-lang#80434 (bootstrap: put the component name in the tarball temp dir path)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 18be436 into rust-lang:master Dec 28, 2020
@rustbot rustbot added this to the 1.51.0 milestone Dec 28, 2020
@jyn514 jyn514 deleted the rustc-macros branch February 25, 2023 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustc_macros is not in rustc API docs
6 participants