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 functions of slice and its iterators. #95274

Merged
merged 6 commits into from
Mar 26, 2022
Merged

add #[must_use] to functions of slice and its iterators. #95274

merged 6 commits into from
Mar 26, 2022

Conversation

jendrikw
Copy link
Contributor

Continuation of #92853.

Tracking issue: #89692.

@Dylan-DPC
Copy link
Member

r? @Dylan-DPC

@Dylan-DPC
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Mar 26, 2022

📌 Commit dcdde01 has been approved by Dylan-DPC

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 26, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Mar 26, 2022
add #[must_use] to functions of slice and its iterators.

Continuation of rust-lang#92853.

Tracking issue: rust-lang#89692.
@Dylan-DPC
Copy link
Member

failed in rollup

@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 Mar 26, 2022
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Mar 26, 2022
@Dylan-DPC
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Mar 26, 2022

📌 Commit 5f88c23 has been approved by Dylan-DPC

@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 Mar 26, 2022
@bors
Copy link
Contributor

bors commented Mar 26, 2022

⌛ Testing commit 5f88c23 with merge 78da86cb08fc3f52a17628bda3d9992d837234e7...

@bors
Copy link
Contributor

bors commented Mar 26, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 26, 2022
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@jendrikw
Copy link
Contributor Author

Spurios 403 from crates.io (failed to get 200 response from `[https://crates.io/api/v1/crates/gimli/0.25.0/download`,](https://crates.io/api/v1/crates/gimli/0.25.0/download%60,) got 403)

@bors retry

@bors
Copy link
Contributor

bors commented Mar 26, 2022

@jendrikw: 🔑 Insufficient privileges: not in try users

@jendrikw
Copy link
Contributor Author

This permission model seems kind of flawed when I can bypass it just by pushing an empty commit...

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 26, 2022
@Dylan-DPC
Copy link
Member

@bors treeclosed=100

@ehuss
Copy link
Contributor

ehuss commented Mar 26, 2022

@bors retry
crates.io 403

@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 Mar 26, 2022
@ehuss
Copy link
Contributor

ehuss commented Mar 26, 2022

@bors p=101

@bors
Copy link
Contributor

bors commented Mar 26, 2022

⌛ Testing commit 763094b with merge 1d9c262...

@nagisa
Copy link
Member

nagisa commented Mar 26, 2022

Note: I have seen a 403 today myself. The error is spurious and will most likely go away after a retry.

@Dylan-DPC
Copy link
Member

@nagisa several prs have been failing with the same problem from last 1-2 hours

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@rust-log-analyzer
Copy link
Collaborator

The job dist-mips-linux failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Contributor

bors commented Mar 26, 2022

☀️ Test successful - checks-actions
Approved by: Dylan-DPC
Pushing 1d9c262 to master...

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1d9c262): comparison url.

Summary: This benchmark run did not return any relevant results. 4 results were found to be statistically significant but too small to be relevant.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 7, 2022
add #[must_use] to functions of slice and its iterators.

Continuation of rust-lang#92853.

Tracking issue: rust-lang#89692.
@dtolnay dtolnay mentioned this pull request Mar 11, 2024
4 tasks
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 25, 2024
…r=Noratrieb

Add `must_use` attribute to `len_utf8` and `len_utf16`.

The `len_utf8` and `len_utf16` methods in `char` should have the `must_use` attribute.

The somewhat similar method `<[T]>::len` has had this attribute since rust-lang#95274. Considering that these two methods would most likely be used to test the size of a buffer (before a call to `encode_utf8` or `encode_utf16`), *not* using their return values could indicate a bug.

According to ["When to add `#[must_use]`](https://std-dev-guide.rust-lang.org/policy/must-use.html), this is **not** considered a breaking change (and could be reverted again at a later time).
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Sep 25, 2024
Rollup merge of rust-lang#130819 - bjoernager:char-must-use-len-utf, r=Noratrieb

Add `must_use` attribute to `len_utf8` and `len_utf16`.

The `len_utf8` and `len_utf16` methods in `char` should have the `must_use` attribute.

The somewhat similar method `<[T]>::len` has had this attribute since rust-lang#95274. Considering that these two methods would most likely be used to test the size of a buffer (before a call to `encode_utf8` or `encode_utf16`), *not* using their return values could indicate a bug.

According to ["When to add `#[must_use]`](https://std-dev-guide.rust-lang.org/policy/must-use.html), this is **not** considered a breaking change (and could be reverted again at a later time).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler 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