mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
14 lines
596 B
Rust
14 lines
596 B
Rust
fn main() {
|
|
// Assert `Iterator` methods are unstable
|
|
assert!([1, 2, 2, 9].iter().is_sorted());
|
|
//~^ ERROR: use of unstable library feature 'is_sorted': new API
|
|
assert!(![-2i32, -1, 0, 3].iter().is_sorted_by_key(|n| n.abs()));
|
|
//~^ ERROR: use of unstable library feature 'is_sorted': new API
|
|
|
|
// Assert `[T]` methods are unstable
|
|
assert!([1, 2, 2, 9].is_sorted());
|
|
//~^ ERROR: use of unstable library feature 'is_sorted': new API
|
|
assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
|
|
//~^ ERROR: use of unstable library feature 'is_sorted': new API
|
|
}
|