]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/tests/ui/question_mark.fixed
Merge commit 'f51aade56f93175dde89177a92e3669ebd8e7592' into clippyup
[rust.git] / src / tools / clippy / tests / ui / question_mark.fixed
index c4c9c82143336647e2dafb04292544c81797c6d5..57f23bd1916ffaa46272f152ebc52f5d79c1f8e3 100644 (file)
@@ -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() {}