2 // Assert `Iterator` methods are unstable
3 assert!([1, 2, 2, 9].iter().is_sorted());
4 //~^ ERROR: use of unstable library feature 'is_sorted': new API
5 assert!(![-2i32, -1, 0, 3].iter().is_sorted_by_key(|n| n.abs()));
6 //~^ ERROR: use of unstable library feature 'is_sorted': new API
8 // Assert `[T]` methods are unstable
9 assert!([1, 2, 2, 9].is_sorted());
10 //~^ ERROR: use of unstable library feature 'is_sorted': new API
11 assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
12 //~^ ERROR: use of unstable library feature 'is_sorted': new API