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: simplify clean by removing FnRetTy #112113

Merged
merged 1 commit into from
May 31, 2023

Conversation

notriddle
Copy link
Contributor

@notriddle notriddle commented May 30, 2023

The default fn ret ty is always unit. Just use that.

Looking back at the time when FnRetTy (then called FunctionRetTy) was first added to rustdoc, it seems to originally be there because -> ! was a special form: the never type didn't exist back then.

eb01b17#diff-384affc1b4190940f114f3fcebbf969e7e18657a71ef9001da6b223a036687d9L921-L924

DefaultReturn was later added to rustdoc to mirror a change in HIR, which added a variant for DefaultReturn because it makes Span management easier. This isn't needed in rustdoc, since it doesn't carry spans.

3f0cc80#diff-384affc1b4190940f114f3fcebbf969e7e18657a71ef9001da6b223a036687d9R1144

@rustbot
Copy link
Collaborator

rustbot commented May 30, 2023

r? @GuillaumeGomez

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

@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend 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 May 30, 2023
@rustbot
Copy link
Collaborator

rustbot commented May 30, 2023

Some changes occurred in src/librustdoc/clean/types.rs

cc @camelid

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
Copy link
Member

Apart from my nit and the failing CI, looks good to me! 👍

The default fn ret ty is always unit. Just use that.

Looking back at the time when `FnRetTy` (then called
`FunctionRetTy`) was first added to rustdoc, it seems to originally
be there because `-> !` was a special form: the never type didn't
exist back then.

rust-lang@eb01b17#diff-384affc1b4190940f114f3fcebbf969e7e18657a71ef9001da6b223a036687d9L921-L924
@GuillaumeGomez
Copy link
Member

Thanks! r=me once CI pass

@notriddle
Copy link
Contributor Author

@bors r=GuillaumeGomez rollup

@bors
Copy link
Contributor

bors commented May 30, 2023

📌 Commit 1862fcb 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 May 30, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request May 31, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#112031 (Migrate  `item_proc_macro` to Askama)
 - rust-lang#112053 (Remove `-Zcgu-partitioning-strategy`.)
 - rust-lang#112069 (offset_of: don't require type to be `Sized`)
 - rust-lang#112084 (enhancements on  build_helper utilization and rustdoc-gui-test)
 - rust-lang#112096 (Remove array_zip)
 - rust-lang#112108 (Fix re-export of doc hidden item inside private item not displayed)
 - rust-lang#112113 (rustdoc: simplify `clean` by removing `FnRetTy`)

r? `@ghost`
`@rustbot` modify labels: rollup
Ok(())
}

pub(crate) fn print_output<'a, 'tcx: 'a>(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pub(crate) fn print_output<'a, 'tcx: 'a>(
fn print_output<'a, 'tcx: 'a>(

unless I'm being blind this isn't being used anywhere else?

Copy link
Member

Choose a reason for hiding this comment

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

Good catch! Wanna send a fix? :)

@bors bors merged commit 77bbfbc into rust-lang:master May 31, 2023
@rustbot rustbot added this to the 1.72.0 milestone May 31, 2023
@notriddle notriddle deleted the notriddle/rm-fnretty branch May 31, 2023 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-json Area: Rustdoc JSON backend 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.

6 participants