rust/compiler
bors b776d1c3e3 Auto merge of #79523 - Nadrieril:fix-usize-ranges, r=varkor
Fix overlap detection of `usize`/`isize` range patterns

`usize` and `isize` are a bit of a special case in the match usefulness algorithm, because the range of values they contain depends on the platform. Specifically, we don't want `0..usize::MAX` to count as an exhaustive match (see also [`precise_pointer_size_matching`](https://github.com/rust-lang/rust/issues/56354)). The way this was initially implemented is by treating those ranges like float ranges, i.e. with limited cleverness. This means we didn't catch the following as unreachable:
```rust
match 0usize {
    0..10 => {},
    10..20 => {},
    5..15 => {}, // oops, should be detected as unreachable
    _ => {},
}
```
This PRs fixes this oversight. Now the only difference between `usize` and `u64` range patterns is in what ranges count as exhaustive.

r? `@varkor`
`@rustbot` label +A-exhaustiveness-checking
2020-11-29 18:50:19 +00:00
..
rustc
rustc_apfloat
rustc_arena Use specialization to avoid copying 2020-11-20 21:02:09 +01:00
rustc_ast Auto merge of #78296 - Aaron1011:fix/stmt-tokens, r=petrochenkov 2020-11-28 07:48:56 +00:00
rustc_ast_lowering Auto merge of #79318 - cjgillot:fitem, r=lcnr 2020-11-27 13:45:22 +00:00
rustc_ast_passes Auto merge of #78296 - Aaron1011:fix/stmt-tokens, r=petrochenkov 2020-11-28 07:48:56 +00:00
rustc_ast_pretty Rollup merge of #79016 - fanzier:underscore-expressions, r=petrochenkov 2020-11-15 13:39:48 +01:00
rustc_attr Never inline naked functions 2020-11-20 00:00:00 +00:00
rustc_builtin_macros Properly handle attributes on statements 2020-11-26 17:08:35 -05:00
rustc_codegen_cranelift Merge commit '5988bbd24aa87732bfa1d111ba00bcdaa22c481a' into sync_cg_clif-2020-11-27 2020-11-27 20:48:53 +01:00
rustc_codegen_llvm Auto merge of #78863 - KodrAus:feat/simd-array, r=oli-obk 2020-11-29 09:28:09 +00:00
rustc_codegen_ssa Auto merge of #78296 - Aaron1011:fix/stmt-tokens, r=petrochenkov 2020-11-28 07:48:56 +00:00
rustc_data_structures Rename optin_builtin_traits to auto_traits 2020-11-23 14:14:06 -08:00
rustc_driver Auto merge of #77671 - flip1995:lint_list_always_plugins, r=oli-obk,Manishearth 2020-11-26 18:51:45 +00:00
rustc_error_codes Slightly improve code samples in E0591 2020-11-27 19:07:14 -08:00
rustc_errors Rollup merge of #74293 - GuillaumeGomez:rustdoc-test-compiler-output-color, r=jyn514 2020-11-17 16:13:46 +01:00
rustc_expand Properly handle attributes on statements 2020-11-26 17:08:35 -05:00
rustc_feature Rename optin_builtin_traits to auto_traits 2020-11-23 14:14:06 -08:00
rustc_fs_util
rustc_graphviz
rustc_hir Formatting. 2020-11-26 21:32:29 +01:00
rustc_hir_pretty Remove ForeignMod struct. 2020-11-26 21:32:27 +01:00
rustc_incremental Remove ForeignMod struct. 2020-11-26 21:32:27 +01:00
rustc_index Stabilise then 2020-11-22 13:45:14 +00:00
rustc_infer Rollup merge of #77758 - Stupremee:turbofish-help-for-const, r=varkor 2020-11-26 13:39:00 +01:00
rustc_interface Auto merge of #78296 - Aaron1011:fix/stmt-tokens, r=petrochenkov 2020-11-28 07:48:56 +00:00
rustc_lexer
rustc_lint Cleanup: shorter and faster code 2020-11-28 17:47:34 +03:00
rustc_lint_defs More consistently use spaces after commas in lists in docs 2020-11-21 14:43:34 -05:00
rustc_llvm Improved version check 2020-11-25 09:45:33 -08:00
rustc_macros Only create OnDiskCache in incremental compilation mode 2020-11-19 15:50:55 -05:00
rustc_metadata Encode proc_macro directly. 2020-11-27 20:39:49 +01:00
rustc_middle Auto merge of #78863 - KodrAus:feat/simd-array, r=oli-obk 2020-11-29 09:28:09 +00:00
rustc_mir Auto merge of #78296 - Aaron1011:fix/stmt-tokens, r=petrochenkov 2020-11-28 07:48:56 +00:00
rustc_mir_build Don't store ty and span in IntRange 2020-11-28 22:07:15 +00:00
rustc_parse Rollup merge of #78853 - calebcartwright:fix-const-block-expr-span, r=spastorino 2020-11-28 15:58:15 +01:00
rustc_parse_format
rustc_passes Do not visit ForeignItemRef for HIR indexing and validation. 2020-11-28 18:08:17 +01:00
rustc_plugin_impl Store ForeignItem in a side table. 2020-11-26 21:29:27 +01:00
rustc_privacy Remove ForeignMod struct. 2020-11-26 21:32:27 +01:00
rustc_query_system Fix typos 2020-11-21 09:06:45 +01:00
rustc_resolve Remove ForeignMod struct. 2020-11-26 21:32:27 +01:00
rustc_save_analysis Remove ForeignMod struct. 2020-11-26 21:32:27 +01:00
rustc_serialize
rustc_session TRACK '-Z polonius' flag 2020-11-24 20:08:54 -08:00
rustc_span Rollup merge of #79464 - GuillaumeGomez:doc-keyword-ident, r=jyn514 2020-11-29 03:14:21 +01:00
rustc_symbol_mangling Store ForeignItem in a side table. 2020-11-26 21:29:27 +01:00
rustc_target Add support for Arm64 Catalyst on ARM Macs 2020-11-26 11:31:59 +01:00
rustc_trait_selection Rollup merge of #79516 - jyn514:cleanup-trait-solver, r=Aaron1011 2020-11-29 03:14:27 +01:00
rustc_traits Don't run resolve_vars_if_possible in normalize_erasing_regions 2020-11-18 12:25:36 -05:00
rustc_ty_utils Fix new 'unnecessary trailing semicolon' warnings 2020-11-26 17:08:36 -05:00
rustc_typeck Auto merge of #78863 - KodrAus:feat/simd-array, r=oli-obk 2020-11-29 09:28:09 +00:00