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

Minor hash_map doc adjustments + item attribute orderings #77072

Merged
merged 1 commit into from
Oct 4, 2020
Merged

Minor hash_map doc adjustments + item attribute orderings #77072

merged 1 commit into from
Oct 4, 2020

Conversation

sharnoff
Copy link
Contributor

This PR is really a couple visual changes glued together:

  1. Some of the doc comments for items in std::collections::hash_map referenced the names of types without escaping their formatting (e.g. using "VacantEntry" instead of "VacantEntry") - the ones I could find were changed to the latter
  2. The vast majority of pre-item attributes seem to place doc comments as the first attribute (instead of things like #[feature(...)]), so the few that had the other order were changed.
  3. Also ordering related: the general trend seems to be that #[feature] attributes follow #[inline], so I swapped the two lines in places where that ordering was reversed. This is primarily a change based on stylistic continuity and aesthetics - I'm not sure how important that actually is / should be.

I figured this would be pretty uncontroversial, but some of these might have been intentional for reasons I don't know about - if so, I'd be happy to remove the relevant changes. Of these, the final set of changes is probably the most unnecessary, so it also might be better to leave those out (in favor of reducing code churn).

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @withoutboats (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 22, 2020
@tesuji
Copy link
Contributor

tesuji commented Sep 23, 2020

r? @jyn514

@jyn514 jyn514 added the C-cleanup Category: PRs that clean code up or issues documenting cleanup. label Sep 23, 2020
@jyn514
Copy link
Member

jyn514 commented Sep 23, 2020

I'm not sure what benefit some of these changes bring ... highlighting things as codeblocks is definitely an improvement but the rest don't seem clearly better or worse to me.

Anyway, I know nothing about libs (#77089 is proof) so r? @LukasKalbertodt for review or reassignment.

@jyn514 jyn514 added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Sep 23, 2020
@sharnoff
Copy link
Contributor Author

sharnoff commented Sep 23, 2020

@jyn514 Yeah... I figured that might be the case. Thanks for the feedback

Edit: For clarification, the primary reason I'm suggesting re-ordering attibutes is for better consistency - in those cases, it was already 90%+ of the items that used that ordering (or much more, in the case of #[feature] before the doc comment). I understand though that this might be something that I care about far more than others.

Copy link
Member

@LukasKalbertodt LukasKalbertodt left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Seem like small useful improvements to me. Doc comments should certainly be the first "attribute" on items and my gut feeling agrees that often #[inline] is above the stability attribute.

@LukasKalbertodt
Copy link
Member

@bors r+ rollup=always

@bors
Copy link
Contributor

bors commented Oct 4, 2020

📌 Commit 8a011b5 has been approved by LukasKalbertodt

@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 Oct 4, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 4, 2020
…as-schievink

Rollup of 8 pull requests

Successful merges:

 - rust-lang#77072 (Minor `hash_map` doc adjustments + item attribute orderings)
 - rust-lang#77368 (Backport LLVM apfloat commit to rustc_apfloat)
 - rust-lang#77445 (BTreeMap: complete the compile-time test_variance test case)
 - rust-lang#77504 (Support vectors with fewer than 8 elements for simd_select_bitmask)
 - rust-lang#77513 (Change DocFragments from enum variant fields to structs with a nested enum)
 - rust-lang#77518 (Only use Fira Sans for the first `td` in item lists)
 - rust-lang#77521 (Move target feature whitelist from cg_llvm to cg_ssa)
 - rust-lang#77525 (Enable RenameReturnPlace MIR optimization on mir-opt-level >= 2)

Failed merges:

r? `@ghost`
@bors bors merged commit 4ae7710 into rust-lang:master Oct 4, 2020
@rustbot rustbot added this to the 1.49.0 milestone Oct 4, 2020
@sharnoff
Copy link
Contributor Author

sharnoff commented Oct 5, 2020

@LukasKalbertodt Cool! Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants