about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-08-06 19:01:41 +0000
committerbors <bors@rust-lang.org>2024-08-06 19:01:41 +0000
commit5ead90f13ae3e03f0c346aea3198f18298960d83 (patch)
tree63dc560335f08e98dc7f32d2c5de71fc3c772a4a /compiler/rustc_pattern_analysis/src
parent9d9a0dcb64407cd68675470ea4e84f9022b389f3 (diff)
parent182c26891e3c64931686e21758613f45a2f83463 (diff)
downloadrust-5ead90f13ae3e03f0c346aea3198f18298960d83.tar.gz
rust-5ead90f13ae3e03f0c346aea3198f18298960d83.zip
Auto merge of #12150 - ithinuel:add_misleading_use_of_ok, r=y21
Add lint for `unused_result_ok`

This PR adds a lint to capture the use of `expr.ok();` when the result is not _really_ used.

This could be interpreted as the result being checked (like it is with `unwrap()` or `expect`) but
it actually only ignores the result.

`let _ = expr;` expresses that intent better.

This was also mentionned in #8994 (although not being the main topic of that issue).

changelog: [`misleading_use_of_ok`]: Add new lint to capture `.ok();` when the result is not _really_ used.
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
0 files changed, 0 insertions, 0 deletions