about summary refs log tree commit diff
path: root/tests/ui/new-range/disabled.rs
blob: 1a5fe3f97436011be92a2da9453331cfa4c1d9e3 (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
25
26
27
//@ check-pass

#![feature(new_range_api)]

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::legacy::RangeFrom<u8> = 1..;
    let b: core::range::legacy::Range<u8> = 2..3;
    let c: core::range::legacy::RangeInclusive<u8> = 4..=5;

    let a: core::ops::RangeFrom<u8> = a;
    let b: core::ops::Range<u8> = b;
    let c: core::ops::RangeInclusive<u8> = c;

    let _: core::ops::RangeFrom<u8> = a.into_iter();
    let _: core::ops::Range<u8> = b.into_iter();
    let _: core::ops::RangeInclusive<u8> = c.into_iter();
}