rust/compiler
Matthias Krüger f530016f50
Rollup merge of #111212 - nicklimmm:issue-107896-fix, r=pnkfelix
Add casting suggestion when assigning negative 2's complement bin or hex literal to a size compatible signed integer

Fixes #107896

The issue stated the case for `iX::MIN` variants. This PR extends the cases for other negative values (in the 2's complement).

Leveraged sign bits to detect such cases.

Example cases:
- <img width="845" alt="image" src="https://user-images.githubusercontent.com/65026286/236289682-19859f59-a9c5-48c5-b15f-78a935fbfcec.png">
- <img width="831" alt="image" src="https://user-images.githubusercontent.com/65026286/236289805-5b16488d-9138-4363-a1b6-a5c027c50aba.png">
- <img width="912" alt="image" src="https://user-images.githubusercontent.com/65026286/236290065-685a9777-034b-4def-83a8-cc4e20b1ed0c.png">
2023-06-15 17:52:35 +02:00
..
rustc
rustc_abi Auto merge of #112062 - lukas-code:unsized-layout, r=wesleywiser 2023-06-13 22:34:59 +00:00
rustc_apfloat
rustc_arena
rustc_ast
rustc_ast_lowering Separate AnonConst from ConstBlock in HIR. 2023-06-02 21:25:18 +00:00
rustc_ast_passes Fix debug ICE for extern type with where clauses 2023-06-12 15:15:45 +08:00
rustc_ast_pretty
rustc_attr
rustc_baked_icu_data
rustc_borrowck split opaque type handling in new solver 2023-06-09 16:41:11 +02:00
rustc_builtin_macros Remove accidental comment 2023-06-07 17:16:34 +00:00
rustc_codegen_cranelift Auto merge of #112314 - ferrocene:pa-core-alloc-abort, r=bjorn3 2023-06-13 19:03:27 +00:00
rustc_codegen_gcc Updated cranelift codegen to reflect modified trait signature 2023-06-04 21:54:38 -04:00
rustc_codegen_llvm Introduce a minimum CGU size in non-incremental builds. 2023-06-14 10:57:44 +10:00
rustc_codegen_ssa Introduce a minimum CGU size in non-incremental builds. 2023-06-14 10:57:44 +10:00
rustc_const_eval Auto merge of #108293 - Jarcho:mut_analyses, r=eholk 2023-06-08 23:58:44 +00:00
rustc_data_structures Don't print Interned or PrivateZst 2023-06-09 00:20:37 +00:00
rustc_driver fix spelling error 2023-06-05 16:01:09 +02:00
rustc_driver_impl Rollup merge of #112109 - Alexendoo:unsupported-split-debuginfo, r=b-naber 2023-06-14 18:10:29 +02:00
rustc_error_codes
rustc_error_messages
rustc_errors s/drain_filter/extract_if/ for Vec, Btree{Map,Set} and LinkedList 2023-06-14 09:28:54 +02:00
rustc_expand expand: Change how #![cfg(FALSE)] behaves on crate root 2023-06-10 00:35:21 +03:00
rustc_feature cleanup 2023-06-03 09:44:30 +08:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz
rustc_hir Removed stable/unstable sort arg from into_sorted_stable_ord, fixed a few misc issues, added collect to UnordItems 2023-06-08 00:38:50 -04:00
rustc_hir_analysis Auto merge of #104455 - the8472:dont-drain-on-drop, r=Amanieu 2023-06-15 00:03:10 +00:00
rustc_hir_pretty Separate AnonConst from ConstBlock in HIR. 2023-06-02 21:25:18 +00:00
rustc_hir_typeck Auto merge of #104455 - the8472:dont-drain-on-drop, r=Amanieu 2023-06-15 00:03:10 +00:00
rustc_incremental Removed stable/unstable sort arg from into_sorted_stable_ord, fixed a few misc issues, added collect to UnordItems 2023-06-08 00:38:50 -04:00
rustc_index
rustc_infer extend assert 2023-06-12 11:58:40 +02:00
rustc_interface Tweak names and docs for vtable stats 2023-06-13 12:07:12 +00:00
rustc_lexer
rustc_lint Rollup merge of #111212 - nicklimmm:issue-107896-fix, r=pnkfelix 2023-06-15 17:52:35 +02:00
rustc_lint_defs Private-in-public lints implementation 2023-06-12 01:02:19 +03:00
rustc_llvm
rustc_log
rustc_macros
rustc_metadata s/drain_filter/extract_if/ for Vec, Btree{Map,Set} and LinkedList 2023-06-14 09:28:54 +02:00
rustc_middle s/drain_filter/extract_if/ for Vec, Btree{Map,Set} and LinkedList 2023-06-14 09:28:54 +02:00
rustc_mir_build Show note for type ascription interpreted as a constant pattern, not a new variable 2023-06-04 20:49:30 +08:00
rustc_mir_dataflow Auto merge of #108293 - Jarcho:mut_analyses, r=eholk 2023-06-08 23:58:44 +00:00
rustc_mir_transform s/drain_filter/extract_if/ for Vec, Btree{Map,Set} and LinkedList 2023-06-14 09:28:54 +02:00
rustc_monomorphize Introduce a minimum CGU size in non-incremental builds. 2023-06-14 10:57:44 +10:00
rustc_parse Rollup merge of #112498 - SamZhang3:rust-reference-link-update, r=Nilstrieb 2023-06-11 01:57:28 +02:00
rustc_parse_format
rustc_passes Rollup merge of #112081 - obeis:doc-test-literal, r=compiler-errors 2023-06-05 23:47:57 +02:00
rustc_plugin_impl
rustc_privacy Private-in-public lints implementation 2023-06-12 01:02:19 +03:00
rustc_query_impl Update field-offset and enable unstable_offset_of 2023-06-05 15:57:13 +02:00
rustc_query_system Rollup merge of #112333 - Zoxc:try_collect_active_jobs-deadlock, r=cjgillot 2023-06-08 12:36:18 +02:00
rustc_resolve Auto merge of #104455 - the8472:dont-drain-on-drop, r=Amanieu 2023-06-15 00:03:10 +00:00
rustc_serialize
rustc_session Auto merge of #112400 - WaffleLapkin:vtable_stats, r=compiler-errors 2023-06-14 11:24:42 +00:00
rustc_smir Use a Stable trait to translate mir -> smir 2023-06-13 15:17:01 -07:00
rustc_span Rollup merge of #112475 - chenyukang:yukang-fix-112278, r=compiler-errors 2023-06-11 01:57:25 +02:00
rustc_symbol_mangling
rustc_target loongarch64-none*: Remove environment component from llvm target 2023-06-13 20:24:22 +08:00
rustc_trait_selection Auto merge of #104455 - the8472:dont-drain-on-drop, r=Amanieu 2023-06-15 00:03:10 +00:00
rustc_traits s/drain_filter/extract_if/ for Vec, Btree{Map,Set} and LinkedList 2023-06-14 09:28:54 +02:00
rustc_transmute Safe Transmute: Refactor error handling and Answer type 2023-06-12 16:56:21 -07:00
rustc_ty_utils Separate AnonConst from ConstBlock in HIR. 2023-06-02 21:25:18 +00:00
rustc_type_ir