rust/tests
bors 1b427b3bf7 Auto merge of #118879 - Nadrieril:lint-range-gap, r=estebank
Lint singleton gaps after exclusive ranges

In the discussion to stabilize exclusive range patterns (https://github.com/rust-lang/rust/issues/37854), it has often come up that they're likely to cause off-by-one mistakes. We already have the `overlapping_range_endpoints` lint, so I [proposed](https://github.com/rust-lang/rust/issues/37854#issuecomment-1845580712) a lint to catch the complementary mistake.

This PR adds a new `non_contiguous_range_endpoints` lint that catches likely off-by-one errors with exclusive range patterns. Here's the idea (see the test file for more examples):
```rust
match x {
    0..10 => ..., // WARN: this range doesn't match `10_u8` because `..` is an exclusive range
    11..20 => ..., // this could appear to continue range `0_u8..10_u8`, but `10_u8` isn't matched by either of them
    _ => ...,
}
// help: use an inclusive range instead: `0_u8..=10_u8`
```

More precisely: for any exclusive range `lo..hi`, if `hi+1` is matched by another range but `hi` isn't, we suggest writing an inclusive range `lo..=hi` instead. We also catch `lo..T::MAX`.
2024-03-09 03:49:01 +00:00
..
assembly Rollup merge of #121832 - heiher:loongarch64-musl, r=wesleywiser 2024-03-08 08:19:18 +01:00
auxiliary
codegen Auto merge of #122182 - matthiaskrgr:rollup-gzimi4c, r=matthiaskrgr 2024-03-08 09:34:05 +00:00
codegen-units [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
coverage [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
coverage-run-rustdoc [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
debuginfo Update debuginfo tests 2024-03-05 00:19:44 +00:00
incremental fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
mir-opt Update MIR with MirPatch in UninhabitedEnumBranching 2024-03-08 08:15:14 +08:00
pretty Re-bless tests/pretty 2024-02-22 16:04:05 +00:00
run-make Rollup merge of #121683 - fortanix:raoul/lvi_fixes, r=cuviper 2024-03-04 22:16:31 +01:00
run-make-fulldeps Rename all ParseSess variables/fields/lifetimes as psess. 2024-03-05 08:11:45 +11:00
run-pass-valgrind [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
rustdoc Update test names to not have dots 2024-03-05 09:02:33 +00:00
rustdoc-gui [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
rustdoc-js [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
rustdoc-js-std
rustdoc-json [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
rustdoc-ui Auto merge of #122190 - matthiaskrgr:rollup-9ol4y30, r=matthiaskrgr 2024-03-08 17:31:00 +00:00
ui Auto merge of #118879 - Nadrieril:lint-range-gap, r=estebank 2024-03-09 03:49:01 +00:00
ui-fulldeps Rewrite the untranslatable_diagnostic lint. 2024-03-06 14:19:01 +11:00
COMPILER_TESTS.md