rust/tests/ui/feature-gates/feature-gate-is_sorted.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
596 B
Rust
Raw Normal View History

fn main() {
2019-09-08 01:34:24 +00:00
// 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
2018-10-12 21:47:01 +00:00
2019-09-08 01:34:24 +00:00
// Assert `[T]` methods are unstable
2018-10-12 21:47:01 +00:00
assert!([1, 2, 2, 9].is_sorted());
//~^ ERROR: use of unstable library feature 'is_sorted': new API
2018-10-12 21:47:01 +00:00
assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
//~^ ERROR: use of unstable library feature 'is_sorted': new API
2018-10-11 22:59:54 +00:00
}