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 }})

@CraftSpider

Changes to make rustdoc cleaning of ty more consistent with hir, and hopefully use it in more places.

r? @camelid

@CraftSpider

@CraftSpider

@rustbot rustbot added the T-rustdoc

Relevant to the rustdoc team, which will review and decide on the PR/issue.

label

Jan 27, 2022

@rust-log-analyzer

This comment has been minimized.

@CraftSpider CraftSpider changed the titleRustdoc ty consistency fixees Rustdoc ty consistency fixes

Jan 27, 2022

@camelid

Can you squash the "Format" commit into the previous commit?

@camelid

I reviewed the first few commits. I'll try to review the rest soon.

@camelid camelid added the C-cleanup

Category: PRs that clean code up or issues documenting cleanup.

label

Jan 27, 2022

@CraftSpider

camelid

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!

@camelid

Sorry for taking so long to review this by the way!

@camelid 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

Feb 11, 2022

@CraftSpider

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'.

camelid

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!

@camelid

@bors

📌 Commit 2d2163b has been approved by camelid

@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

Mar 1, 2022

bors added a commit to rust-lang-ci/rust that referenced this pull request

Mar 1, 2022

@bors

Rollup of 7 pull requests

Successful merges:

Failed merges:

r? @ghost @rustbot modify labels: rollup

Labels

C-cleanup

Category: PRs that clean code up or issues documenting cleanup.

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

T-rustdoc

Relevant to the rustdoc team, which will review and decide on the PR/issue.