-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Cleanup handling of crate_name
for doctests
#86501
Conversation
r? @CraftSpider (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
@bors r+ |
📌 Commit 615198d97f833ff84065e44d7fc12009700883a4 has been approved by |
src/librustdoc/doctest.rs
Outdated
let mut global_ctxt = queries.global_ctxt()?.take(); | ||
|
||
let collector = global_ctxt.enter(|tcx| { | ||
let krate = tcx.hir().krate(); | ||
let crate_attrs = tcx.hir().attrs(CRATE_HIR_ID); | ||
|
||
let mut opts = scrape_test_config(crate_attrs); | ||
opts.display_warnings |= options.display_warnings; | ||
let opts = scrape_test_config(crate_attrs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Err. I accidentally removed this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, my fault for missing that. Honestly, I thought it was part of your changes to name handling at first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No big deal, I missed it too 😆
@bors r- until I fix the bug |
It's much more complicated than just going through the TyCtxt.
This makes it consistent with rustc_session::Options.
@bors r=CraftSpider Thanks for the review! |
📌 Commit ff0e046 has been approved by |
Cleanup handling of `crate_name` for doctests - Remove unnecessary reallocation - Remove unnecessary messing around with `queries` for the crate name; it's simpler and faster to go through the TyCtxt instead - Rename `cratename` -> `crate_name` for consistency with the rest of the compiler
Cleanup handling of `crate_name` for doctests - Remove unnecessary reallocation - Remove unnecessary messing around with `queries` for the crate name; it's simpler and faster to go through the TyCtxt instead - Rename `cratename` -> `crate_name` for consistency with the rest of the compiler
Rollup of 6 pull requests Successful merges: - rust-lang#86393 (Add regression test for issue rust-lang#52025) - rust-lang#86402 (rustdoc: add optional woff2 versions of Source Serif and Source Code) - rust-lang#86451 (Resolve intra-doc links in summary desc) - rust-lang#86501 (Cleanup handling of `crate_name` for doctests) - rust-lang#86517 (Fix `unused_unsafe` around `await`) - rust-lang#86537 (Mark some edition tests as check-pass) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
queries
for the crate name; it's simpler and faster to go through the TyCtxt insteadcratename
->crate_name
for consistency with the rest of the compiler