about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/try_err.fixed
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-08-09 00:03:38 +0200
committerGitHub <noreply@github.com>2024-08-09 00:03:38 +0200
commit58c6497e4cb5ce4a22446d41514d4fe2da9e7300 (patch)
tree4baa8ca9c40e0a6a220acbc2329a67da370358ca /src/tools/clippy/tests/ui/try_err.fixed
parent8789b95b673f5baec5596a210c957ad62948724d (diff)
parent8be2688e456f5d79448564e55f35272821d6246b (diff)
Rollup merge of #128837 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? ``@Manishearth``

Updates Cargo.lock due to uitest bump
Diffstat (limited to 'src/tools/clippy/tests/ui/try_err.fixed')
-rw-r--r--src/tools/clippy/tests/ui/try_err.fixed10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/tools/clippy/tests/ui/try_err.fixed b/src/tools/clippy/tests/ui/try_err.fixed
index aae4f8ac47f..f149bfb7774 100644
--- a/src/tools/clippy/tests/ui/try_err.fixed
+++ b/src/tools/clippy/tests/ui/try_err.fixed
@@ -1,5 +1,5 @@
 //@aux-build:proc_macros.rs
-
+#![feature(try_blocks)]
 #![deny(clippy::try_err)]
 #![allow(
     clippy::unnecessary_wraps,
@@ -152,3 +152,11 @@ pub fn try_return(x: bool) -> Result<i32, i32> {
     }
     Ok(0)
 }
+
+// Test that the lint is suppressed in try block.
+pub fn try_block() -> Result<(), i32> {
+    let _: Result<_, i32> = try {
+        Err(1)?;
+    };
+    Ok(())
+}