about summary refs log tree commit diff
path: root/tests/ui/new-range/enabled.rs
blob: a5fb76ad52b72373b364e47cbfdfffb4048f99a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//@ check-pass

#![feature(new_range_api)]
#![feature(new_range)]

fn main() {
    // Unchanged
    let a: core::range::RangeFull = ..;
    let b: core::range::RangeTo<u8> = ..2;
    let c: core::range::RangeToInclusive<u8> = ..=3;

    let _: core::ops::RangeFull = a;
    let _: core::ops::RangeTo<u8> = b;
    let _: core::ops::RangeToInclusive<u8> = c;

    // 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 _: core::range::IterRangeFrom<u8> = a.into_iter();
    let _: core::range::IterRange<u8> = b.into_iter();
    let _: core::range::IterRangeInclusive<u8> = c.into_iter();
}