Skip to content

Commit 8ebeaf1

Browse files
committed
Add regression test for negative unsigned literals in patterns
1 parent 5e55679 commit 8ebeaf1

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#![feature(pattern_types)]
2+
#![feature(pattern_type_macro)]
3+
4+
//@ check-pass
5+
6+
use std::pat::pattern_type;
7+
8+
type Sign = pattern_type!(u32 is -10..);
9+
10+
type SignedChar = pattern_type!(char is -'A'..);
11+
12+
fn main() {
13+
match 42_u8 {
14+
-10..253 => {}
15+
_ => {}
16+
}
17+
18+
match 'A' {
19+
-'\0'..'a' => {}
20+
_ => {}
21+
}
22+
}

0 commit comments

Comments
 (0)