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

Add #[must_use] to len and is_empty #89786

Merged
merged 1 commit into from
Oct 31, 2021

Conversation

jkugelman
Copy link
Contributor

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 11, 2021
@joshtriplett
Copy link
Member

r=me with the nit fixed in the tests.

@jkugelman jkugelman force-pushed the must-use-len-and-is_empty branch from 229f707 to 64bb2c1 Compare October 11, 2021 21:21
@joshtriplett
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Oct 11, 2021

📌 Commit 64bb2c1 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 11, 2021
@joshtriplett joshtriplett added the relnotes Marks issues that should be documented in the release notes of the next release. label Oct 11, 2021
@the8472 the8472 added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Oct 11, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 12, 2021
…, r=joshtriplett

Add #[must_use] to len and is_empty

Parent issue: rust-lang#89692

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

Add #[must_use] to len and is_empty

Parent issue: rust-lang#89692

r? ``@joshtriplett``
@the8472
Copy link
Member

the8472 commented Oct 12, 2021

Looks like this failed a rollup in #89801 (comment)

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 12, 2021
@jkugelman jkugelman force-pushed the must-use-len-and-is_empty branch from 64bb2c1 to c509346 Compare October 12, 2021 13:10
@jkugelman
Copy link
Contributor Author

Clippy test fixed and blessed. I'll make sure to run the Clippy test suite in my future PRs since CI doesn't seem to catch them.

How did this make it past the CI checks? Should I submit an issue against the CI system?

@jkugelman
Copy link
Contributor Author

It looks like the clippy tests are only run for individual PRs if something in clippy has changed. They're not run for all PRs because it would add too much CI time.

#77016

This runs the tools builder (which builds and tests tools, including clippy) when the clippy submodule changes. This essentially returns us to the prior state when clippy was a submodule; it makes sense for us to test it on CI when it changes. It might make sense for it to be tested regardless of changing but it is somewhat rare for it to fail and we don't want to add to CI time for the majority of PRs which don't affect it.

false_positive.into_iter().count();
let _ = false_positive.iter().count();
let _ = false_positive.iter_mut().count();
let _ = false_positive.into_iter().count();
Copy link
Member

Choose a reason for hiding this comment

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

I think for tests it would be fine to just supress the warning instead of adding tons of let _.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll defer to @joshtriplett.

Copy link
Member

Choose a reason for hiding this comment

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

I personally prefer adding let _ =, but I don't have a strong preference, and if the maintainer of these tests prefers to suppress the lint that's fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Who's the maintainer? Do I have an action?

Copy link
Member

Choose a reason for hiding this comment

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

I don't have a strong preference, so go ahead and switch this one to suppress the lint.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@jkugelman jkugelman force-pushed the must-use-len-and-is_empty branch from c509346 to 6745e8d Compare October 30, 2021 23:25
@joshtriplett
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Oct 31, 2021

📌 Commit 6745e8d 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 31, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 31, 2021
…askrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#89068 (Restructure std::rt (part 2))
 - rust-lang#89786 (Add #[must_use] to len and is_empty)
 - rust-lang#90430 (Add #[must_use] to remaining std functions (A-N))
 - rust-lang#90431 (Add #[must_use] to remaining std functions (O-Z))

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 88e5ae2 into rust-lang:master Oct 31, 2021
@rustbot rustbot added this to the 1.58.0 milestone Oct 31, 2021
@jkugelman jkugelman deleted the must-use-len-and-is_empty branch October 31, 2021 17:35
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 4, 2021
…, r=joshtriplett

Add #[must_use] to len and is_empty

Parent issue: rust-lang#89692

r? `@joshtriplett`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants