Skip to content

Conversation

yotamofek
Copy link
Contributor

inner_full_print was pretty hard to follow IMHO.
Hopefully this cleans it up a little bit.

Also, it was checking whether self.inputs is empty twice, and then handling an unreachable match arm:
https://github.com/yotamofek/rust/blob/f836ae4e663b6e8938096b8559e094d18361be55/src/librustdoc/html/format.rs#L1368C1-L1368C33
last_input_index could only be None if the fn has no parameters, in which case the loop body would never run.

r? @GuillaumeGomez if you have the capacity :)

BTW, can we rename FnDecl::inputs to parameters or something? And output to return_ty?

@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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Sep 16, 2025
@yotamofek yotamofek force-pushed the pr/rustdoc/fndecl_inner_full_print branch from 6a962cd to 90b964f Compare September 16, 2025 16:53
@fmease
Copy link
Member

fmease commented Sep 17, 2025

Thanks, that reads a lot better!

BTW, can we rename FnDecl::inputs to parameters or something? And output to return_ty?

Personally speaking, I would be in favor. However, we have a bunch of other places in src/librustdoc (and even rustc) which use this terminology (which I'm also not super fond of) and it would be best if most of the renames could be done at one. Feel free to do that in a follow-up PR, tho.

r=me with nit addressed

@bors delegate+

@bors
Copy link
Collaborator

bors commented Sep 17, 2025

✌️ @yotamofek, you can now approve this pull request!

If @fmease told you to "r=me" after making some further change, please make that change, then do @bors r=@fmease

@fmease fmease assigned fmease and unassigned GuillaumeGomez Sep 17, 2025
@yotamofek yotamofek force-pushed the pr/rustdoc/fndecl_inner_full_print branch from 90b964f to 1d8971c Compare September 17, 2025 17:20
@yotamofek
Copy link
Contributor Author

@bors r=@fmease

@bors
Copy link
Collaborator

bors commented Sep 17, 2025

📌 Commit 1d8971c has been approved by fmease

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 Sep 17, 2025
@fmease
Copy link
Member

fmease commented Sep 17, 2025

@bors rollup

fmease added a commit to fmease/rust that referenced this pull request Sep 18, 2025
…full_print, r=fmease

Cleanup `FnDecl::inner_full_print`

`inner_full_print` was pretty hard to follow IMHO.
Hopefully this cleans it up a little bit.

Also, it was checking whether `self.inputs` is empty twice, and then handling an unreachable match arm:
https://github.com/yotamofek/rust/blob/f836ae4e663b6e8938096b8559e094d18361be55/src/librustdoc/html/format.rs#L1368C1-L1368C33
`last_input_index` could only be `None` if the fn has no parameters, in which case the loop body would never run.

r? `@GuillaumeGomez` if you have the capacity :)

BTW, can we rename `FnDecl::inputs` to `parameters` or something? And `output` to `return_ty`?
bors added a commit that referenced this pull request Sep 18, 2025
Rollup of 5 pull requests

Successful merges:

 - #146566 (Lint more overlapping assignments in MIR.)
 - #146645 (Cleanup `FnDecl::inner_full_print`)
 - #146664 (Clean up `ty::Dynamic`)
 - #146673 (cg_llvm: Replace some DIBuilder wrappers with LLVM-C API bindings (part 4))
 - #146694 (Remove ImplSubject)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 34a805b into rust-lang:master Sep 18, 2025
10 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Sep 18, 2025
rust-timer added a commit that referenced this pull request Sep 18, 2025
Rollup merge of #146645 - yotamofek:pr/rustdoc/fndecl_inner_full_print, r=fmease

Cleanup `FnDecl::inner_full_print`

`inner_full_print` was pretty hard to follow IMHO.
Hopefully this cleans it up a little bit.

Also, it was checking whether `self.inputs` is empty twice, and then handling an unreachable match arm:
https://github.com/yotamofek/rust/blob/f836ae4e663b6e8938096b8559e094d18361be55/src/librustdoc/html/format.rs#L1368C1-L1368C33
`last_input_index` could only be `None` if the fn has no parameters, in which case the loop body would never run.

r? ``@GuillaumeGomez`` if you have the capacity :)

BTW, can we rename `FnDecl::inputs` to `parameters` or something? And `output` to `return_ty`?
@yotamofek yotamofek deleted the pr/rustdoc/fndecl_inner_full_print branch September 23, 2025 13:58
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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants