add regression test
This commit is contained in:
parent
a02ec4cf18
commit
f3d7b39cdf
1 changed files with 20 additions and 0 deletions
20
src/test/ui/array-slice-vec/slice_is_sorted_by_borrow.rs
Normal file
20
src/test/ui/array-slice-vec/slice_is_sorted_by_borrow.rs
Normal file
|
|
@ -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()));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue