]> git.lizzy.rs Git - rust.git/blob - tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs
Rollup merge of #106766 - GuillaumeGomez:rm-stripper-dead-code, r=notriddle
[rust.git] / tests / ui / half-open-range-patterns / half-open-range-pats-inclusive-no-end.rs
1 // Test `X...` and `X..=` range patterns not being allowed syntactically.
2 // FIXME(Centril): perhaps these should be semantic restrictions.
3
4 fn main() {}
5
6 #[cfg(FALSE)]
7 fn foo() {
8     if let 0... = 1 {} //~ ERROR inclusive range with no end
9     if let 0..= = 1 {} //~ ERROR inclusive range with no end
10     const X: u8 = 0;
11     if let X... = 1 {} //~ ERROR inclusive range with no end
12     if let X..= = 1 {} //~ ERROR inclusive range with no end
13 }
14
15 fn bar() {
16     macro_rules! mac {
17         ($e:expr) => {
18             let $e...; //~ ERROR inclusive range with no end
19             let $e..=; //~ ERROR inclusive range with no end
20         }
21     }
22
23     mac!(0);
24 }