Skip to content

Conversation

compiler-errors
Copy link
Member

Self-explanatory

Fixes #145257

@rustbot
Copy link
Collaborator

rustbot commented Aug 11, 2025

r? @wesleywiser

rustbot has assigned @wesleywiser.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 11, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 11, 2025

Some changes occurred in compiler/rustc_passes/src/check_attr.rs

cc @jdonszelmann

@@ -133,4 +135,5 @@ fn main() {
}
let s = PatternField { #[must_use] foo: 123 }; //~ ERROR `#[must_use]` has no effect
let PatternField { #[must_use] foo } = s; //~ ERROR `#[must_use]` has no effect
let _ = foo;
Copy link
Member Author

Choose a reason for hiding this comment

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

@run-rustfix requires that all warnings are gone, and foo is unused, so I'm suppressing it here.

@fmease
Copy link
Member

fmease commented Aug 11, 2025

Thenks!~

r? fmease @bors r+ rollup

@bors
Copy link
Collaborator

bors commented Aug 11, 2025

📌 Commit 6c571e7 has been approved by fmease

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 Aug 11, 2025
@rust-log-analyzer

This comment has been minimized.

@fmease
Copy link
Member

fmease commented Aug 11, 2025

@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 Aug 11, 2025
@compiler-errors
Copy link
Member Author

Will bless when I am back at my computer

@fmease
Copy link
Member

fmease commented Aug 12, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 12, 2025

📌 Commit 2c0409c has been approved by fmease

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 12, 2025
bors added a commit that referenced this pull request Aug 13, 2025
Rollup of 11 pull requests

Successful merges:

 - #143467 (Add ASCII-related methods from `u8` and `MIN`/`MAX` to `core::ascii::Char`)
 - #144519 (Constify `SystemTime` methods)
 - #144642 (editorconfig: don't trim trailing whitespace in tests)
 - #144870 (Stabilize `path_file_prefix` feature)
 - #145269 (Deprecate RUST_TEST_* env variables)
 - #145274 (Remove unused `#[must_use]`)
 - #145289 (chore(ci): upgrade checkout to v5)
 - #145303 (Docs: Link to payload_as_str() from payload().)
 - #145308 (Adjust documentation of `dangling`)
 - #145320 (Allow cross-compiling the Cranelift dist component)
 - #145325 (Add `cast_init` and `cast_uninit` methods for pointers)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c2bc926 into rust-lang:master Aug 13, 2025
10 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 13, 2025
rust-timer added a commit that referenced this pull request Aug 13, 2025
Rollup merge of #145274 - compiler-errors:unused-must-use, r=fmease

Remove unused `#[must_use]`

Self-explanatory

Fixes #145257
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 18, 2025
…=jdonszelmann

Port must_use to the new target checking

This PR ports `must_use` to the new target checking logic
This also adds a tool-only suggestion to remove attributes on invalid targets, as to not immediately undo the work of rust-lang#145274

r? ``@jdonszelmann``
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 18, 2025
…=jdonszelmann

Port must_use to the new target checking

This PR ports `must_use` to the new target checking logic
This also adds a tool-only suggestion to remove attributes on invalid targets, as to not immediately undo the work of rust-lang#145274

r? ```@jdonszelmann```
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Aug 19, 2025
…=jdonszelmann

Port must_use to the new target checking

This PR ports `must_use` to the new target checking logic
This also adds a tool-only suggestion to remove attributes on invalid targets, as to not immediately undo the work of rust-lang#145274

r? `@jdonszelmann`
rust-timer added a commit that referenced this pull request Aug 19, 2025
Rollup merge of #145500 - JonathanBrouwer:must_use_target, r=jdonszelmann

Port must_use to the new target checking

This PR ports `must_use` to the new target checking logic
This also adds a tool-only suggestion to remove attributes on invalid targets, as to not immediately undo the work of #145274

r? `@jdonszelmann`
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Aug 20, 2025
…mann

Port must_use to the new target checking

This PR ports `must_use` to the new target checking logic
This also adds a tool-only suggestion to remove attributes on invalid targets, as to not immediately undo the work of rust-lang/rust#145274

r? `@jdonszelmann`
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Aug 25, 2025
…mann

Port must_use to the new target checking

This PR ports `must_use` to the new target checking logic
This also adds a tool-only suggestion to remove attributes on invalid targets, as to not immediately undo the work of rust-lang/rust#145274

r? `@jdonszelmann`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) 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.

unused must_use warning should have an auto-fix to just remove the useless attribute
6 participants