about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorQuinn Sinclair <me@partiallytyped.dev>2023-12-21 13:26:46 +0200
committerQuinn Sinclair <me@partiallytyped.dev>2024-01-21 02:49:27 +0100
commitf73879e096301b921cc763c15f7020ff72736988 (patch)
treea1ff4d45d172e4c1d36e738cc2560ac2cf6b046f /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parenta71211d0b52c01f1b37fe544e0e13fd1bdc31979 (diff)
downloadrust-f73879e096301b921cc763c15f7020ff72736988.tar.gz
rust-f73879e096301b921cc763c15f7020ff72736988.zip
`unused_io_amount` captures `Ok(_)`s
Partial rewrite of `unused_io_account` to lint over Ok(_).

Moved the check to `check_block` to simplify context checking for
expressions and allow us to check only some expressions.

For match (expr, arms) we emit a lint for io ops used on `expr` when an
arm is `Ok(_)`. Also considers the cases when there are guards in the
arms. It also captures `if let Ok(_) = ...` cases.

For `Ok(_)` it emits a note indicating where the value is ignored.

changelog: False Negatives [`unused_io_amount`]: Extended
`unused_io_amount` to catch `Ok(_)`s in `If let` and match exprs.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions