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

style-guide: Narrow guidance about references and dereferencing #113143

Merged

Conversation

joshtriplett
Copy link
Member

The style guide advises "prefer dereferencing to taking references", but
doesn't give guidance on when that "preference" should get overridden by
other considerations. Give an example of when it's fine to ignore
that advice.

The style guide advises "prefer dereferencing to taking references", but
doesn't give guidance on when that "preference" should get overridden by
other considerations. Give an example of when it's fine to ignore
that advice.
@rustbot
Copy link
Collaborator

rustbot commented Jun 29, 2023

r? @calebcartwright

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-style Relevant to the style team, which will review and decide on the PR/issue. labels Jun 29, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jun 29, 2023

Some changes occurred in src/doc/style-guide

cc @rust-lang/style

Copy link
Member

@calebcartwright calebcartwright left a comment

Choose a reason for hiding this comment

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

To the best of my recollection, tools (e.g. rustfmt) don't attempt to make any modifications here so I view this as one of those "tips for the human programmer" vs something tools could enforce. rustfmt certainly couldn't make the determination around the degree of expense anyway 😄

@calebcartwright
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 29, 2023

📌 Commit 025dd3a has been approved by calebcartwright

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 Jun 29, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 29, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#112670 (privacy: Type privacy lints fixes and cleanups)
 - rust-lang#112929 (Test that we require implementing trait items whose bounds don't hold in the current impl)
 - rust-lang#113054 (Make `rustc_on_unimplemented` std-agnostic)
 - rust-lang#113137 (don't suggest `move` for borrows that aren't closures)
 - rust-lang#113139 (style-guide: Clarify let-else further)
 - rust-lang#113140 (style-guide: Add an example of formatting a multi-line attribute)
 - rust-lang#113143 (style-guide: Narrow guidance about references and dereferencing)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7a7ffce into rust-lang:master Jun 29, 2023
11 checks passed
@rustbot rustbot added this to the 1.72.0 milestone Jun 29, 2023
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-style Relevant to the style team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants