summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/needless_return.fixed
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/tools/clippy/tests/ui/needless_return.fixed46
1 files changed, 39 insertions, 7 deletions
diff --git a/src/tools/clippy/tests/ui/needless_return.fixed b/src/tools/clippy/tests/ui/needless_return.fixed
index 0bc0d0011..d2163b14f 100644
--- a/src/tools/clippy/tests/ui/needless_return.fixed
+++ b/src/tools/clippy/tests/ui/needless_return.fixed
@@ -1,7 +1,6 @@
// run-rustfix
#![feature(lint_reasons)]
-#![feature(let_else)]
#![allow(unused)]
#![allow(
clippy::if_same_then_else,
@@ -228,13 +227,46 @@ fn needless_return_macro() -> String {
format!("Hello {}", "world!")
}
-fn check_expect() -> bool {
- if true {
- // no error!
- return true;
+fn issue_9361() -> i32 {
+ #[allow(clippy::integer_arithmetic)]
+ return 1 + 2;
+}
+
+fn issue8336(x: i32) -> bool {
+ if x > 0 {
+ println!("something");
+ true
+ } else {
+ false
+ }
+}
+
+fn issue8156(x: u8) -> u64 {
+ match x {
+ 80 => {
+ 10
+ },
+ _ => {
+ 100
+ },
+ }
+}
+
+// Ideally the compiler should throw `unused_braces` in this case
+fn issue9192() -> i32 {
+ {
+ 0
+ }
+}
+
+fn issue9503(x: usize) -> isize {
+ unsafe {
+ if x > 12 {
+ *(x as *const isize)
+ } else {
+ !*(x as *const isize)
+ }
}
- #[expect(clippy::needless_return)]
- return true;
}
fn main() {}