Skip to content

Commit

Permalink
Add regression test for negative unsigned literals in patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Feb 3, 2025
1 parent 613bdd4 commit bce763c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/ui/type/pattern_types/signed_ranges.rs
Original file line number Diff line number Diff line change
@@ -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' => {}
_ => {}
}
}

0 comments on commit bce763c

Please sign in to comment.