Files
rust/compiler
许杰友 Jieyou Xu (Joe) f9f667f8b9 Rollup merge of #136304 - oli-obk:push-ymxoklvzrpvx, r=Nadrieril
Reject negative literals for unsigned or char types in pattern ranges and literals

It sucks a bit that we have to duplicate the work here (normal expressions just get this for free from the `ExprKind::UnOp(UnOp::Neg, ...)` typeck logic.

In https://github.com/rust-lang/rust/pull/134228 I caused

```rust
fn main() {
    match 42_u8 {
        -10..255 => {},
        _ => {}
    }
}
```

to just compile without even a lint.

I can't believe we didn't have tests for this

Amusingly https://github.com/rust-lang/rust/pull/136302 will also register a delayed bug in `lit_to_const` for this, so we'll have a redundancy if something like this fails again.
2025-02-05 19:09:34 +08:00
..
2025-02-02 17:38:19 +11:00
2025-01-07 14:30:02 +02:00
2025-01-29 09:48:08 +01:00
2025-02-03 12:53:57 -08:00
2025-01-30 17:47:44 +01:00
2025-02-03 12:53:57 -08:00