]> git.lizzy.rs Git - rust.git/commit
Show code suggestions in `let_undescore` lint messages.
authorAaron Kofsky <aaronko@umich.edu>
Sat, 4 Jun 2022 01:33:13 +0000 (21:33 -0400)
committerAaron Kofsky <aaronko@umich.edu>
Sat, 4 Jun 2022 19:35:13 +0000 (15:35 -0400)
commiteba6c789dcfca7065d1c292c06eb447ac9895db3
treeab1c5c0ef860cad7606256e9b1fc97de9252011c
parentae2ac3b4c568d2d20cb395a57a163e1e298d6d6c
Show code suggestions in `let_undescore` lint messages.

This commit uses `span_suggestion_verbose` to add what specific code
changes can be done as suggested by the lint--in this case, either binding
the expression to an unused variable or using `std::mem::drop` to drop
the value explicitly.
compiler/rustc_lint/src/let_underscore.rs
src/test/ui/let_underscore/let_underscore_drop.stderr
src/test/ui/let_underscore/let_underscore_lock.stderr
src/test/ui/let_underscore/let_underscore_must_use.stderr