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

rustdoc: convert if let Some() that always matches to variable #112251

Merged
merged 1 commit into from
Jun 7, 2023

Conversation

notriddle
Copy link
Contributor

No description provided.

@rustbot
Copy link
Collaborator

rustbot commented Jun 3, 2023

r? @GuillaumeGomez

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jun 3, 2023
@@ -290,27 +290,29 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {

if !please_inline {
let inherits_hidden = inherits_doc_hidden(tcx, res_did, None);
let item_def_id = reexport_chain(tcx, def_id, res_did)
Copy link
Member

Choose a reason for hiding this comment

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

This changes things a bit: reexport_chain and all the rest were only called if the item was private or was inheriting doc(hidden).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't just use if let, because the first item in a chain isn't allowed to be irrefutable.

Maybe I should factor this out into its own function instead?

Copy link
Member

Choose a reason for hiding this comment

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

That would also allow to make it easier to understand what's going on so big 👍

@GuillaumeGomez
Copy link
Member

Thanks!

@GuillaumeGomez
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 4, 2023

📌 Commit a59e20b0215748e77db496b2b5ea88ca0b16d260 has been approved by GuillaumeGomez

It is now in the queue for this repository.

@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 Jun 4, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 4, 2023
…iaskrgr

Rollup of 3 pull requests

Successful merges:

 - rust-lang#112247 (rust-lld: add rpath entry to the correct `lib` folder)
 - rust-lang#112274 (Migrate GUI colors test to original CSS color format)
 - rust-lang#112277 (Don't require the output from libtest to be valid UTF-8)

Failed merges:

 - rust-lang#112251 (rustdoc: convert `if let Some()` that always matches to variable)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2023
…llaumeGomez

Rollup of 6 pull requests

Successful merges:

 - rust-lang#112243 (Remove unneeded `Buffer` allocations when `&mut fmt::Write` can be used directly)
 - rust-lang#112263 (Remove ExtendElement, ExtendWith, extend_with)
 - rust-lang#112291 (Disable RustAnalyzer check by default, run Rustfmt check before)
 - rust-lang#112299 (Don't double-print status messages in GHA)
 - rust-lang#112311 (Ignore fluent message reordering in `git blame`)
 - rust-lang#112315 (fix spelling error)

Failed merges:

 - rust-lang#112251 (rustdoc: convert `if let Some()` that always matches to variable)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#112081 (Avoid ICE on `#![doc(test(...)]` with literal parameter)
 - rust-lang#112196 (Resolve vars in result from `scrape_region_constraints`)
 - rust-lang#112303 (Normalize in infcx instead of globally for `Option::as_deref` suggestion)
 - rust-lang#112316 (Ensure space is inserted after keyword in `unused_delims`)
 - rust-lang#112318 (Merge method, type and const object safety checks)
 - rust-lang#112322 (Don't mention `IMPLIED_BOUNDS_ENTAILMENT` if signatures reference error)

Failed merges:

 - rust-lang#112251 (rustdoc: convert `if let Some()` that always matches to variable)

r? `@ghost`
`@rustbot` modify labels: rollup
@notriddle notriddle added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 6, 2023
@GuillaumeGomez
Copy link
Member

Didn't I already approve it? 😆

@notriddle
Copy link
Contributor Author

You did. It got a merge conflict, so I rebased it, and needed to manually merge in the changes (specifically, && !tcx.is_doc_hidden(item_def_id) is pulled in from https://github.com/rust-lang/rust/pull/112178/files#diff-4b76d999d0f2e74f6df3724a36a6b96302b16968a2f7af48d2b4c08048f8f871R311)

@GuillaumeGomez
Copy link
Member

Oh I see. Sorry I completely missed that.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 6, 2023

📌 Commit 0f1aaef has been approved by GuillaumeGomez

It is now in the queue for this repository.

@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 Jun 6, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 7, 2023
Rollup of 6 pull requests

Successful merges:

 - rust-lang#112076 (Fall back to bidirectional normalizes-to if no subst-relate candidate in alias-relate goal)
 - rust-lang#112122 (Add `-Ztrait-solver=next-coherence`)
 - rust-lang#112251 (rustdoc: convert `if let Some()` that always matches to variable)
 - rust-lang#112345 (fix(expand): prevent infinity loop in macro containing only "///")
 - rust-lang#112359 (Respect `RUST_BACKTRACE` for delayed bugs)
 - rust-lang#112382 (download-rustc: Fix `x test core` on MacOS)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c6fda40 into rust-lang:master Jun 7, 2023
11 checks passed
@rustbot rustbot added this to the 1.72.0 milestone Jun 7, 2023
@notriddle notriddle deleted the notriddle/cleanup-inlining branch June 7, 2023 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants