Skip to content

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

Merged
bors merged 1 commit into
rust-lang:masterfrom
joshtriplett:style-guide-narrow-dereference-guidance
Jun 29, 2023
Merged

style-guide: Narrow guidance about references and dereferencing#113143
bors merged 1 commit into
rust-lang:masterfrom
joshtriplett:style-guide-narrow-dereference-guidance

Conversation

@joshtriplett

Copy link
Copy Markdown
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

rustbot commented Jun 29, 2023

Copy link
Copy Markdown
Collaborator

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

rustbot commented Jun 29, 2023

Copy link
Copy Markdown
Collaborator

Some changes occurred in src/doc/style-guide

cc @rust-lang/style

@calebcartwright calebcartwright left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

@bors r+ rollup

@bors

bors commented Jun 29, 2023

Copy link
Copy Markdown
Collaborator

📌 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
@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