Skip to content

Add #[must_use] to non-mutating verb methods #89796

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Oct 12, 2021

Conversation

jkugelman
Copy link
Contributor

@jkugelman jkugelman commented Oct 12, 2021

These are methods that could be misconstrued to mutate their input, similar to #89694. I gave each one a different custom message.

I wrote that upgrade and downgrade don't modify the input pointers. Logically they don't, but technically they do...

Parent issue: #89692

r? @joshtriplett

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 12, 2021
@rust-log-analyzer

This comment has been minimized.

@jkugelman jkugelman force-pushed the must-use-non-mutating-verb-methods branch from 31c9232 to c3f0577 Compare October 12, 2021 01:21
@joshtriplett joshtriplett added the relnotes Marks issues that should be documented in the release notes of the next release. label Oct 12, 2021
@joshtriplett
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 12, 2021

📌 Commit c3f0577 has been approved by joshtriplett

@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 12, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 12, 2021
…b-methods, r=joshtriplett

Add #[must_use] to non-mutating verb methods

These are methods that could be misconstrued to mutate their input, similar to rust-lang#89694. I gave each one a different custom message.

I wrote that `upgrade` and `downgrade` don't modify the input pointers. Logically they don't, but technically they do...

Parent issue: rust-lang#89692

r? `@joshtriplett`
the8472 added a commit to the8472/rust that referenced this pull request Oct 12, 2021
…b-methods, r=joshtriplett

Add #[must_use] to non-mutating verb methods

These are methods that could be misconstrued to mutate their input, similar to rust-lang#89694. I gave each one a different custom message.

I wrote that `upgrade` and `downgrade` don't modify the input pointers. Logically they don't, but technically they do...

Parent issue: rust-lang#89692

r? ``@joshtriplett``
This was referenced Oct 12, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 12, 2021
Rollup of 7 pull requests

Successful merges:

 - rust-lang#89778 (Add #[must_use] to as_type conversions)
 - rust-lang#89784 (Remove built-in query cache_hit tracking)
 - rust-lang#89796 (Add #[must_use] to non-mutating verb methods)
 - rust-lang#89797 (Add #[must_use] to is_condition tests)
 - rust-lang#89799 (fix minor spelling error in Poll::ready docs)
 - rust-lang#89800 (Update books)
 - rust-lang#89809 (Remap ssa RealPredicate to llvm RealPredicate)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@Skgland
Copy link
Contributor

Skgland commented Oct 12, 2021

Is it intentional that RC::downgrade is left out?

@bors bors merged commit a1bdd48 into rust-lang:master Oct 12, 2021
@rustbot rustbot added this to the 1.57.0 milestone Oct 12, 2021
@jkugelman
Copy link
Contributor Author

Is it intentional that RC::downgrade is left out?

Sure isn't. Submitted #89833.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 31, 2021
…joshtriplett

Add #[must_use] to Rc::downgrade

Missed this in previous PR rust-lang#89796 (comment)

Parent issue: rust-lang#89692

r? `@joshtriplett`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 31, 2021
…joshtriplett

Add #[must_use] to Rc::downgrade

Missed this in previous PR rust-lang#89796 (comment)

Parent issue: rust-lang#89692

r? ``@joshtriplett``
@jkugelman jkugelman deleted the must-use-non-mutating-verb-methods branch October 31, 2021 02:20
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 31, 2021
…joshtriplett

Add #[must_use] to Rc::downgrade

Missed this in previous PR rust-lang#89796 (comment)

Parent issue: rust-lang#89692

r? ```@joshtriplett```
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants