-
Notifications
You must be signed in to change notification settings - Fork 13.5k
rustdoc-json: Keep empty generic args if parenthesized #142932
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
Conversation
Because in the case of for example pub fn my_fn3(f: impl FnMut()) {} we want to keep `()` even if it is empty since that matches e.g. Rust syntax requirements.
These commits modify Please ensure that if you've changed the output:
|
Good catch, it was unintentional to affect the parenthesized case. I think we'll need to bump |
Thanks for taking a look. I don't think we need to bump FORMAT_VERSION though since the format doesn't change? There is no change in how to interpret the JSON. |
I don't have a full handle on when to bump the version number. This change does alter the output in some cases, though as you say, how to interpret the output is unchanged. I'll defer to @aDotInTheVoid... |
Thanks for the fix. Yeah, I don't think this needs a FORMAT_VERSION bump, as it won't break any deserialization, or parsing of strings contained within. @bors r+ rollup |
… r=aDotInTheVoid rustdoc-json: Keep empty generic args if parenthesized Because in the case of for example pub fn my_fn3(f: impl FnMut()) {} we want to keep `()` even if it is empty since that matches e.g. Rust syntax requirements. This is an amendment to rust-lang#142502, so: r? `@aDotInTheVoid` cc `@nnethercote` cc cargo-public-api/cargo-public-api#798
Rollup of 8 pull requests Successful merges: - #140622 (compiletest: Improve diagnostics for line annotation mismatches) - #142641 (Generate symbols.o for proc-macros too) - #142695 (Port `#[rustc_skip_during_method_dispatch]` to the new attribute system) - #142742 ([win][aarch64] Fix linking statics on Arm64EC, take 2) - #142894 (phantom_variance_markers: fix identifier usage in macro) - #142928 (Fix hang in --print=file-names in bootstrap) - #142930 (Account for beta revisions when normalizing versions) - #142932 (rustdoc-json: Keep empty generic args if parenthesized) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 9 pull requests Successful merges: - #140005 (Set MSG_NOSIGNAL for UnixStream) - #140622 (compiletest: Improve diagnostics for line annotation mismatches) - #142354 (Fixes firefox copy paste issue) - #142695 (Port `#[rustc_skip_during_method_dispatch]` to the new attribute system) - #142779 (Add note about `str::split` handling of no matches.) - #142894 (phantom_variance_markers: fix identifier usage in macro) - #142928 (Fix hang in --print=file-names in bootstrap) - #142932 (rustdoc-json: Keep empty generic args if parenthesized) - #142933 (Simplify root goal API of solver a bit) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #142932 - Enselic:keep-empty-generic-params, r=aDotInTheVoid rustdoc-json: Keep empty generic args if parenthesized Because in the case of for example pub fn my_fn3(f: impl FnMut()) {} we want to keep `()` even if it is empty since that matches e.g. Rust syntax requirements. This is an amendment to #142502, so: r? ``@aDotInTheVoid`` cc ``@nnethercote`` cc cargo-public-api/cargo-public-api#798
Because in the case of for example
we want to keep
()
even if it is empty since that matches e.g. Rust syntax requirements.This is an amendment to #142502, so:
r? @aDotInTheVoid
cc @nnethercote
cc cargo-public-api/cargo-public-api#798