diff --git a/tests/ui/type/pattern_types/signed_ranges.rs b/tests/ui/type/pattern_types/signed_ranges.rs new file mode 100644 index 0000000000000..9e250309aca42 --- /dev/null +++ b/tests/ui/type/pattern_types/signed_ranges.rs @@ -0,0 +1,22 @@ +#![feature(pattern_types)] +#![feature(pattern_type_macro)] + +//@ check-pass + +use std::pat::pattern_type; + +type Sign = pattern_type!(u32 is -10..); + +type SignedChar = pattern_type!(char is -'A'..); + +fn main() { + match 42_u8 { + -10..253 => {} + _ => {} + } + + match 'A' { + -'\0'..'a' => {} + _ => {} + } +}