Fix for assertions_on_result_states
incorrectly changes return type
#9450
Labels
C-bug
Category: Clippy is not doing the correct thing
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
Summary
assert!(res.is_err())
always returns()
, butres.unwrap_err()
returns the err type itself - this can cause auto-fixed code to fail to compile if there's a missing semicolon at the end of a test, for example.Reproducer
I tried this code:
I expected to see this happen:
Instead, this happened:
causing a type error
Version
Additional Labels
@rustbot label +I-suggestion-causes-err
The text was updated successfully, but these errors were encountered: