rust/compiler/rustc_trait_selection/src
Matthias Krüger 9adf2189f5
Rollup merge of #137449 - compiler-errors:control-flow, r=Amanieu,lnicola
Denote `ControlFlow` as `#[must_use]`

I've repeatedly hit bugs in the compiler due to `ControlFlow` not being marked `#[must_use]`. There seems to be an accepted ACP to make the type `#[must_use]` (https://github.com/rust-lang/libs-team/issues/444), so this PR implements that part of it.

Most of the usages in the compiler that trigger this new warning are "root" usages (calling into an API that uses control-flow internally, but for which the callee doesn't really care) and have been suppressed by `let _ = ...`, but I did legitimately find one instance of a missing `?` and one for a never-used `ControlFlow` value in #137448.

Presumably this needs an FCP too, so I'm opening this and nominating it for T-libs-api.

This PR also touches the tools (incl. rust-analyzer), but if this went into FCP, I'd split those out into separate PRs which can land before this one does.

r? libs-api
`@rustbot` label: T-libs-api I-libs-api-nominated
2025-03-17 16:34:47 +01:00
..
error_reporting Rollup merge of #137449 - compiler-errors:control-flow, r=Amanieu,lnicola 2025-03-17 16:34:47 +01:00
errors Teach structured errors to display short Ty 2025-02-25 16:56:03 +00:00
solve Fold visit into ty 2025-03-15 06:34:36 +00:00
traits Suppress must_use in compiler and tools 2025-03-16 17:47:57 +00:00
errors.rs Teach structured errors to display short Ty 2025-02-25 16:56:03 +00:00
infer.rs Add UseCloned trait related code 2025-03-06 17:58:32 -03:00
lib.rs Remove #![warn(unreachable_pub)] from all compiler/ crates. 2025-03-11 13:14:21 +11:00
regions.rs Only use implied bounds hack if bevy, and use deeply normalize in implied bounds hack 2025-03-04 18:18:48 +00:00
solve.rs impossible obligations check fast path 2024-10-10 06:09:50 -04:00