Skip to content

Commit 1d81b53

Browse files
committed
Add regression test
1 parent 5e55679 commit 1d81b53

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//! Check that overflowing literals are in patterns are rejected
2+
3+
#![feature(pattern_types)]
4+
#![feature(pattern_type_macro)]
5+
6+
//@ check-pass
7+
8+
use std::pat::pattern_type;
9+
10+
// FIXME(pattern_types): also reject overflowing literals
11+
type TooBig = pattern_type!(u8 is 500..);
12+
type TooSmall = pattern_type!(i8 is -500..);
13+
14+
fn main() {
15+
match 5_u8 {
16+
500 => {}
17+
_ => {}
18+
}
19+
}

0 commit comments

Comments
 (0)