We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a02ec4c commit f3d7b39Copy full SHA for f3d7b39
src/test/ui/array-slice-vec/slice_is_sorted_by_borrow.rs
@@ -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
16
+ name: "2".to_string(),
17
18
+ ];
19
+ assert!(a.is_sorted_by_key(|a| a.name.as_str()));
20
0 commit comments