Skip to content

Commit

Permalink
add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Markeffsky committed Oct 12, 2022
1 parent a02ec4c commit f3d7b39
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/test/ui/array-slice-vec/slice_is_sorted_by_borrow.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// check-pass
// regression test for https://github.com/rust-lang/rust/issues/53485#issuecomment-885393452

#![feature(is_sorted)]

struct A {
name: String,
}

fn main() {
let a = &[
A {
name: "1".to_string(),
},
A {
name: "2".to_string(),
},
];
assert!(a.is_sorted_by_key(|a| a.name.as_str()));
}

0 comments on commit f3d7b39

Please sign in to comment.