Rustdoc ty consistency fixes by CraftSpider · Pull Request #93385 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation13 Commits5 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Changes to make rustdoc cleaning of ty more consistent with hir, and hopefully use it in more places.
r? @camelid
Relevant to the rustdoc team, which will review and decide on the PR/issue.
label
This comment has been minimized.
CraftSpider changed the title
Rustdoc ty consistency fixees Rustdoc ty consistency fixes
Can you squash the "Format" commit into the previous commit?
I reviewed the first few commits. I'll try to review the rest soon.
Category: PRs that clean code up or issues documenting cleanup.
label
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me overall but I'm a bit unclear about d90138b. Could you explain the goal of that commit? Also, the last commit doesn't actually make hir and ty use the same code paths so the commit message is a little confusing. Most of the code is actually still different. It'd probably be hard to fully merge them until type aliases are represented in ty though.
| sig: ty::PolyFnSig<'_>, |
|---|
| ) -> FnDecl { |
| let mut names = if did.is_local() { &[] } else { cx.tcx.fn_arg_names(did) }.iter(); |
| let mut names = did.map_or(&[] as &[_], |did |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, could this be a behavior change when this is called with an external function? I think if it is, it'd be a bugfix, but I wanted to check. In the inline code path (inline.rs), this is called with Some(did), where did should be non-local.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should only change code on local functions, external functions always took the else case and are thus equivalent to Some. Local function behavior should be affected as an intentional fix related to this PR.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I got confused. Thanks!
Sorry for taking so long to review this by the way!
camelid added S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Commit d90138b is reverting a change I made in an earlier PR that was necessary before these fixes - There's a JSON test that ensures removing it here didn't cause a regression. The comment about 'same code path' is meant to mean that the two different functions calculate what items are impl items the same way, not that they're fully the same code paths but that they should now use the same rules for what is an 'impl of a trait'.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry again this took so long!
📌 Commit 2d2163b has been approved by camelid
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
bors added a commit to rust-lang-ci/rust that referenced this pull request
Rollup of 7 pull requests
Successful merges:
- rust-lang#91545 (Generalize "remove
&" and "add*" suggestions to more than one deref) - rust-lang#93385 (Rustdoc ty consistency fixes)
- rust-lang#93926 (Lint against more useless
#[must_use]attributes) - rust-lang#94094 (use BOOL for TCP_NODELAY setsockopt value on Windows)
- rust-lang#94384 (Add Atomic*::from_mut_slice)
- rust-lang#94448 (5 - Make more use of
let_chains) - rust-lang#94452 (Sync portable-simd for bitmasks &c.)
Failed merges:
r? @ghost
@rustbot modify labels: rollup
Labels
Category: PRs that clean code up or issues documenting cleanup.
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the rustdoc team, which will review and decide on the PR/issue.