Files
rust/tests/ui/new-range/enabled.rs
Trevor Gross 1c8c2e548e core: Stabilize RangeFull and RangeTo re-exports in core::range
Stabilized under `new_range_api_exports`. Newly stable API:

    core::range::RangeFull;
    core::range::RangeTo;
2026-06-10 21:07:26 -05:00

25 lines
760 B
Rust

//! With the `new_range` feature enabled, `..` syntax resolves to the new range types.
//@ check-pass
#![feature(new_range)]
fn main() {
// Unchanged
let a: core::ops::RangeFull = ..;
let b: core::ops::RangeTo<u8> = ..2;
let _: core::range::RangeFull = a;
let _: core::range::RangeTo<u8> = b;
// Changed
let a: core::range::RangeFrom<u8> = 1..;
let b: core::range::Range<u8> = 2..3;
let c: core::range::RangeInclusive<u8> = 4..=5;
let d: core::range::RangeToInclusive<u8> = ..=3;
let _: core::range::RangeFromIter<u8> = a.into_iter();
let _: core::range::RangeIter<u8> = b.into_iter();
let _: core::range::RangeInclusiveIter<u8> = c.into_iter();
// RangeToInclusive has no Iterator implementation
}