diff options
Diffstat (limited to '')
-rw-r--r-- | src/tools/clippy/tests/ui/question_mark.fixed | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/question_mark.fixed b/src/tools/clippy/tests/ui/question_mark.fixed index c4c9c8214..57f23bd19 100644 --- a/src/tools/clippy/tests/ui/question_mark.fixed +++ b/src/tools/clippy/tests/ui/question_mark.fixed @@ -207,4 +207,19 @@ fn option_map() -> Option<bool> { } } +pub struct PatternedError { + flag: bool, +} + +// No warning +fn pattern() -> Result<(), PatternedError> { + let res = Ok(()); + + if let Err(err @ PatternedError { flag: true }) = res { + return Err(err); + } + + res +} + fn main() {} |