]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/tests/ui/needless_return.rs
Merge commit '7f27e2e74ef957baa382dc05cf08df6368165c74' into clippyup
[rust.git] / src / tools / clippy / tests / ui / needless_return.rs
index 666dc54b76b412b2267e083d3d130929cc07309e..abed338bb9b297c415a2cf0115728cd54e6f29a5 100644 (file)
@@ -1,6 +1,7 @@
 // run-rustfix
 
 #![feature(lint_reasons)]
+#![feature(yeet_expr)]
 #![allow(unused)]
 #![allow(
     clippy::if_same_then_else,
@@ -282,4 +283,18 @@ pub fn oneline() {
     }
 }
 
+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 {
+        return Ok(format!("ok!"));
+    } else {
+        return Err(format!("err!"));
+    }
+}
+
 fn main() {}