Skip to content

Commit f3d7b39

Browse files
author
Lukas Markeffsky
committed
add regression test
1 parent a02ec4c commit f3d7b39

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// check-pass
2+
// regression test for https://github.com/rust-lang/rust/issues/53485#issuecomment-885393452
3+
4+
#![feature(is_sorted)]
5+
6+
struct A {
7+
name: String,
8+
}
9+
10+
fn main() {
11+
let a = &[
12+
A {
13+
name: "1".to_string(),
14+
},
15+
A {
16+
name: "2".to_string(),
17+
},
18+
];
19+
assert!(a.is_sorted_by_key(|a| a.name.as_str()));
20+
}

0 commit comments

Comments
 (0)