]> git.lizzy.rs Git - rust.git/blob - tests/ui/array-slice-vec/slice_is_sorted_by_borrow.rs
Rollup merge of #106715 - BoxyUwU:new_solver_triagebot, r=lcnr
[rust.git] / tests / ui / array-slice-vec / slice_is_sorted_by_borrow.rs
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 }