2018-10-11 09:53:15 -07:00
|
|
|
fn main() {
|
2019-09-08 09:34:24 +08:00
|
|
|
// Assert `Iterator` methods are unstable
|
2018-10-11 09:53:15 -07:00
|
|
|
assert!([1, 2, 2, 9].iter().is_sorted());
|
2019-01-17 22:33:25 -08:00
|
|
|
//~^ ERROR: use of unstable library feature 'is_sorted': new API
|
2018-10-11 09:53:15 -07:00
|
|
|
assert!(![-2i32, -1, 0, 3].iter().is_sorted_by_key(|n| n.abs()));
|
2019-01-17 22:33:25 -08:00
|
|
|
//~^ ERROR: use of unstable library feature 'is_sorted': new API
|
2018-10-12 14:47:01 -07:00
|
|
|
|
2019-09-08 09:34:24 +08:00
|
|
|
// Assert `[T]` methods are unstable
|
2018-10-12 14:47:01 -07:00
|
|
|
assert!([1, 2, 2, 9].is_sorted());
|
2019-01-17 22:33:25 -08:00
|
|
|
//~^ ERROR: use of unstable library feature 'is_sorted': new API
|
2018-10-12 14:47:01 -07:00
|
|
|
assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
|
2019-01-17 22:33:25 -08:00
|
|
|
//~^ ERROR: use of unstable library feature 'is_sorted': new API
|
2018-10-11 15:59:54 -07:00
|
|
|
}
|