summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/needless_return.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/tools/clippy/tests/ui/needless_return.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/needless_return.rs b/src/tools/clippy/tests/ui/needless_return.rs
index 666dc54b7..abed338bb 100644
--- a/src/tools/clippy/tests/ui/needless_return.rs
+++ b/src/tools/clippy/tests/ui/needless_return.rs
@@ -1,6 +1,7 @@
// run-rustfix
#![feature(lint_reasons)]
+#![feature(yeet_expr)]
#![allow(unused)]
#![allow(
clippy::if_same_then_else,
@@ -282,4 +283,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 {
+ return Ok(format!("ok!"));
+ } else {
+ return Err(format!("err!"));
+ }
+}
+
fn main() {}