add #[must_use] to functions of slice and its iterators. by jendrikw · Pull Request #95274 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation33 Commits6 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

jendrikw

@jendrikw

@Dylan-DPC

@Dylan-DPC

@bors

📌 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

@Dylan-DPC

@Dylan-DPC

@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

@jendrikw

@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

@bors

📌 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

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

@bors

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

@jendrikw

@rust-log-analyzer

This comment has been minimized.

@jendrikw

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

@jendrikw: 🔑 Insufficient privileges: not in try users

@jendrikw

@jendrikw

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

@jendrikw

@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

@ehuss

@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

@bors bors mentioned this pull request

Mar 26, 2022

@bors

@nagisa

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

@Dylan-DPC

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

This was referenced

Mar 26, 2022

@rust-log-analyzer

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

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

This was referenced

Mar 26, 2022

@rust-timer

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

@bors

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Sep 25, 2024

@matthiaskrgr

…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], 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

@rust-timer

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], this is not considered a breaking change (and could be reverted again at a later time).

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.