summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/match_single_binding.fixed
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
commit1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch)
tree3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /src/tools/clippy/tests/ui/match_single_binding.fixed
parentReleasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz
rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/match_single_binding.fixed')
-rw-r--r--src/tools/clippy/tests/ui/match_single_binding.fixed41
1 files changed, 33 insertions, 8 deletions
diff --git a/src/tools/clippy/tests/ui/match_single_binding.fixed b/src/tools/clippy/tests/ui/match_single_binding.fixed
index 6cfb6661a..201301cc9 100644
--- a/src/tools/clippy/tests/ui/match_single_binding.fixed
+++ b/src/tools/clippy/tests/ui/match_single_binding.fixed
@@ -1,7 +1,12 @@
// run-rustfix
#![warn(clippy::match_single_binding)]
-#![allow(unused_variables)]
-#![allow(clippy::toplevel_ref_arg, clippy::uninlined_format_args)]
+#![allow(
+ unused,
+ clippy::let_unit_value,
+ clippy::no_effect,
+ clippy::toplevel_ref_arg,
+ clippy::uninlined_format_args
+)]
struct Point {
x: i32,
@@ -109,10 +114,9 @@ fn main() {
// Lint
let x = 1;
- println!("Not an array index start");
+ println!("Not an array index start")
}
-#[allow(dead_code)]
fn issue_8723() {
let (mut val, idx) = ("a b", 1);
@@ -125,16 +129,15 @@ fn issue_8723() {
let _ = val;
}
-#[allow(dead_code)]
+fn side_effects() {}
+
fn issue_9575() {
- fn side_effects() {}
let _ = || {
side_effects();
- println!("Needs curlies");
+ println!("Needs curlies")
};
}
-#[allow(dead_code)]
fn issue_9725(r: Option<u32>) {
let x = r;
match x {
@@ -146,3 +149,25 @@ fn issue_9725(r: Option<u32>) {
},
};
}
+
+fn issue_10447() -> usize {
+ ();
+
+ let a = ();
+
+ side_effects();
+
+ let b = side_effects();
+
+ println!("1");
+
+ let c = println!("1");
+
+ let in_expr = [
+ (),
+ side_effects(),
+ println!("1"),
+ ];
+
+ 2
+}