Allowing clippy::unwrap_used
in const contexts
#14198
Labels
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
Description
clippy::unwrap_used
andclippy::expect_used
lint in const contexts, but that doesn't make much sense, because if the operations fail and panic, rustc will error out regardless. The fact that we are in a const context forms a guarantee in itself that theunwrap
orexpect
call is fine.See also: #9307
For example:
Reports:
But this is worthless, because if we change
X
toNone
, we get an error from rustc anyway:Version
Additional Labels
@rustbot label +C-enhancement
The text was updated successfully, but these errors were encountered: