From c23a457e72abe608715ac76f076f47dc42af07a5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 20:31:44 +0200 Subject: Merging upstream version 1.74.1+dfsg1. Signed-off-by: Daniel Baumann --- src/tools/clippy/tests/ui/unit_return_expecting_ord.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/tools/clippy/tests/ui/unit_return_expecting_ord.rs') diff --git a/src/tools/clippy/tests/ui/unit_return_expecting_ord.rs b/src/tools/clippy/tests/ui/unit_return_expecting_ord.rs index f2a9694f9..59b2f7e35 100644 --- a/src/tools/clippy/tests/ui/unit_return_expecting_ord.rs +++ b/src/tools/clippy/tests/ui/unit_return_expecting_ord.rs @@ -17,13 +17,16 @@ fn unit(_i: isize) {} fn main() { let mut structs = vec![Struct { field: 2 }, Struct { field: 1 }]; structs.sort_by_key(|s| { + //~^ ERROR: this closure returns the unit type which also implements Ord double(s.field); }); structs.sort_by_key(|s| double(s.field)); structs.is_sorted_by_key(|s| { + //~^ ERROR: this closure returns the unit type which also implements PartialOrd double(s.field); }); structs.is_sorted_by_key(|s| { + //~^ ERROR: this closure returns the unit type which also implements PartialOrd if s.field > 0 { () } else { @@ -34,4 +37,5 @@ fn main() { return double(s.field); }); structs.sort_by_key(|s| unit(s.field)); + //~^ ERROR: this closure returns the unit type which also implements Ord } -- cgit v1.2.3