question_mark
inside try
blocks
#8628
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
Summary
The rewrites suggested by
question_mark
do not work correctly insidetry
blocks (unstable with#![feature(try_blocks)]
), since?
exits thetry
block rather than the function.I don't know what the policy is for unstable features, so just close this if it's irrelevant.
Lint Name
question_mark
Reproducer
With the following function,
Clippy suggests rewriting it as
However,
foo1(None)
givesNone
, whilefoo2(None)
givesSome(128)
, which is not the same.Version
Additional Labels
@rustbot label +I-suggestion-causes-error
The text was updated successfully, but these errors were encountered: