]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/tests/ui/needless_return.fixed
Merge commit '7f27e2e74ef957baa382dc05cf08df6368165c74' into clippyup
[rust.git] / src / tools / clippy / tests / ui / needless_return.fixed
index 4386aaec49e2437751803ac8f9ce216c17e79f07..ab1c0e590bbc7ca317ea0568eebee557090b7623 100644 (file)
@@ -1,6 +1,7 @@
 // run-rustfix
 
 #![feature(lint_reasons)]
+#![feature(yeet_expr)]
 #![allow(unused)]
 #![allow(
     clippy::if_same_then_else,
@@ -272,4 +273,18 @@ mod issue9416 {
     }
 }
 
+fn issue9947() -> Result<(), String> {
+    do yeet "hello";
+}
+
+// without anyhow, but triggers the same bug I believe
+#[expect(clippy::useless_format)]
+fn issue10051() -> Result<String, String> {
+    if true {
+        Ok(format!("ok!"))
+    } else {
+        Err(format!("err!"))
+    }
+}
+
 fn main() {}