rust/compiler/rustc_middle/src
bors 7fc6365570 Auto merge of #116692 - Nadrieril:half-open-ranges, r=cjgillot
Match usize/isize exhaustively with half-open ranges

The long-awaited finale to the saga of [exhaustiveness checking for integers](https://github.com/rust-lang/rust/pull/50912)!

```rust
match 0usize {
    0.. => {} // exhaustive!
}
match 0usize {
    0..usize::MAX => {} // helpful error message!
}
```

Features:
- Half-open ranges behave as expected for `usize`/`isize`;
- Trying to use `0..usize::MAX` will tell you that `usize::MAX..` is missing and explain why. No more unhelpful "`_` is missing";
- Everything else stays the same.

This should unblock https://github.com/rust-lang/rust/issues/37854.

Review-wise:
- I recommend looking commit-by-commit;
- This regresses perf because of the added complexity in `IntRange`; hopefully not too much;
- I measured each `#[inline]`, they all help a bit with the perf regression (tho I don't get why);
- I did not touch MIR building; I expect there's an easy PR there that would skip unnecessary comparisons when the range is half-open.
2023-11-01 03:17:19 +00:00
..
dep_graph Move DepKind to rustc_query_system and define it as u16 2023-09-21 17:06:14 +02:00
hir Auto merge of #116849 - oli-obk:error_shenanigans, r=cjgillot 2023-10-23 09:59:40 +00:00
hooks Turn const_caller_location from a query to a hook 2023-10-31 16:15:18 +00:00
infer Uplift Canonical to rustc_type_ir 2023-10-25 16:25:09 +00:00
middle Add method for checking if deprecation is a rustc version 2023-10-30 17:13:38 -07:00
mir Turn const_caller_location from a query to a hook 2023-10-31 16:15:18 +00:00
query Turn const_caller_location from a query to a hook 2023-10-31 16:15:18 +00:00
thir Address review comments 2023-10-16 15:58:01 +00:00
traits Make gen blocks implement the Iterator trait 2023-10-27 13:05:48 +00:00
ty Auto merge of #116692 - Nadrieril:half-open-ranges, r=cjgillot 2023-11-01 03:17:19 +00:00
util Merge ExternProviders into the general Providers struct 2023-09-22 20:15:34 +00:00
arena.rs Implement Deref<LayoutS> for Layout 2023-10-02 21:31:16 +02:00
error.rs don't point at const usage site for resolution-time errors 2023-09-14 22:34:05 +02:00
lib.rs s/generator/coroutine/ 2023-10-20 21:14:01 +00:00
lint.rs give FutureIncompatibilityReason variants more explicit names 2023-09-22 08:51:18 +02:00
macros.rs Rename CloneLiftImpls as TrivialLiftImpls. 2023-09-18 09:37:09 +10:00
metadata.rs rustc_metadata: Remove Span from ModChild 2023-04-18 17:25:04 +03:00
tests.rs
thir.rs Propagate half-open ranges through THIR 2023-10-27 19:56:12 +02:00
values.rs Format all the let chains in compiler 2023-10-13 08:59:36 +00:00