-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred in src/librustdoc/clean/types.rs cc @camelid |
This comment has been minimized.
This comment has been minimized.
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
9c87dfa
to
1862fcb
Compare
Thanks! r=me once CI pass |
@bors r=GuillaumeGomez rollup |
…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>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
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? :)
The default fn ret ty is always unit. Just use that.
Looking back at the time when
FnRetTy
(then calledFunctionRetTy
) 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 makesSpan
management easier. This isn't needed in rustdoc, since it doesn't carry spans.3f0cc80#diff-384affc1b4190940f114f3fcebbf969e7e18657a71ef9001da6b223a036687d9R1144