rust/compiler
Jubilee 864eba9fb1
Rollup merge of #136895 - maurer:fix-enum-discr, r=nikic
debuginfo: Set bitwidth appropriately in enum variant tags

Previously, we unconditionally set the bitwidth to 128-bits, the largest an enum would possibly be. Then, LLVM would cut down the constant by chopping off leading zeroes before emitting the DWARF. LLVM only supported 64-bit enumerators, so this would also have occasionally resulted in truncated data.

LLVM added support for 128-bit enumerators in llvm/llvm-project#125578

That patchset trusts the constant to describe how wide the variant tag is, so the high 64-bits of zeros are considered potentially load-bearing.

As a result, we went from emitting tags that looked like:
DW_AT_discr_value     (0xfe)

(because `dwarf::BestForm` selected `data1`)

to emitting tags that looked like:
DW_AT_discr_value	(<0x10> fe ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 )

This makes the `DW_AT_discr_value` encode at the bitwidth of the tag, which:
1. Is probably closer to our intentions in terms of describing the data.
2. Doesn't invoke the 128-bit support which may not be supported by all debuggers / downstream tools.
3. Will result in smaller debug information.
2025-02-13 17:46:08 -08:00
..
rustc
rustc_abi Split out the extern_system_varargs feature 2025-02-12 19:57:45 -08:00
rustc_arena
rustc_ast Add a TyPat in the AST to reuse the generic arg lowering logic 2025-02-11 08:51:05 +00:00
rustc_ast_ir
rustc_ast_lowering Rollup merge of #136901 - workingjubilee:stabilize-externabi-hashing-forever, r=compiler-errors 2025-02-12 20:30:55 +01:00
rustc_ast_passes compiler: remove rustc_target reexport of rustc_abi::HashStableContext 2025-02-11 18:55:48 -08:00
rustc_ast_pretty Add a TyPat in the AST to reuse the generic arg lowering logic 2025-02-11 08:51:05 +00:00
rustc_attr_data_structures
rustc_attr_parsing Rustfmt 2025-02-08 22:12:13 +00:00
rustc_baked_icu_data
rustc_borrowck Rollup merge of #136559 - compiler-errors:resolve-regions-for-type-test-failure, r=BoxyUwU 2025-02-13 03:53:29 -05:00
rustc_builtin_macros Rollup merge of #136646 - oli-obk:pattern-types-ast, r=BoxyUwU 2025-02-12 06:07:37 +01:00
rustc_codegen_cranelift Rollup merge of #136660 - compiler-errors:BikeshedGuaranteedNoDrop, r=lcnr 2025-02-13 03:53:30 -05:00
rustc_codegen_gcc Rollup merge of #136858 - safinaskar:parallel-cleanup-2025-02-11-07-54, r=SparrowLii 2025-02-13 03:53:31 -05:00
rustc_codegen_llvm Rollup merge of #136895 - maurer:fix-enum-discr, r=nikic 2025-02-13 17:46:08 -08:00
rustc_codegen_ssa Auto merge of #136954 - jhpratt:rollup-koefsot, r=jhpratt 2025-02-13 02:13:24 +00:00
rustc_const_eval Auto merge of #136593 - lukas-code:ty-value-perf, r=oli-obk 2025-02-13 15:27:30 +00:00
rustc_data_structures compiler/rustc_data_structures/src/sync/worker_local.rs: delete "unsafe impl Sync" 2025-02-11 10:21:17 +03:00
rustc_driver
rustc_driver_impl compiler: compare and hash ExternAbi like its string 2025-02-11 20:18:01 -08:00
rustc_error_codes fix the error code document 2025-02-10 04:36:49 +08:00
rustc_error_messages
rustc_errors compiler: replace ExternAbi::name calls with formatters 2025-02-11 19:42:47 -08:00
rustc_expand Rollup merge of #136107 - dingxiangfei2009:coerce-pointee-wellformed, r=compiler-errors 2025-02-11 02:53:42 +01:00
rustc_feature Auto merge of #136965 - jhpratt:rollup-bsnqvmf, r=jhpratt 2025-02-13 11:45:11 +00:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz Rustfmt 2025-02-08 22:12:13 +00:00
rustc_hir Implement and use BikeshedGuaranteedNoDrop for union/unsafe field validity 2025-02-13 03:45:04 +00:00
rustc_hir_analysis Auto merge of #136593 - lukas-code:ty-value-perf, r=oli-obk 2025-02-13 15:27:30 +00:00
rustc_hir_pretty Rustfmt 2025-02-08 22:12:13 +00:00
rustc_hir_typeck Auto merge of #136965 - jhpratt:rollup-bsnqvmf, r=jhpratt 2025-02-13 11:45:11 +00:00
rustc_incremental Rustfmt 2025-02-08 22:12:13 +00:00
rustc_index Rustfmt 2025-02-08 22:12:13 +00:00
rustc_index_macros
rustc_infer Rustfmt 2025-02-08 22:12:13 +00:00
rustc_interface Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrum 2025-02-09 15:44:16 +00:00
rustc_lexer Rustfmt 2025-02-08 22:12:13 +00:00
rustc_lint Auto merge of #135994 - 1c3t3a:rename-unsafe-ptr, r=oli-obk 2025-02-12 23:18:14 +00:00
rustc_lint_defs Implement lint for definition site item shadowing too 2025-02-13 05:45:53 +00:00
rustc_llvm Rollup merge of #136419 - EnzymeAD:autodiff-tests, r=onur-ozkan,jieyouxu 2025-02-10 16:38:23 +01:00
rustc_log
rustc_macros Rustfmt 2025-02-08 22:12:13 +00:00
rustc_metadata Rustfmt 2025-02-08 22:12:13 +00:00
rustc_middle Auto merge of #136593 - lukas-code:ty-value-perf, r=oli-obk 2025-02-13 15:27:30 +00:00
rustc_mir_build Auto merge of #136593 - lukas-code:ty-value-perf, r=oli-obk 2025-02-13 15:27:30 +00:00
rustc_mir_dataflow Rustfmt 2025-02-08 22:12:13 +00:00
rustc_mir_transform Auto merge of #135994 - 1c3t3a:rename-unsafe-ptr, r=oli-obk 2025-02-12 23:18:14 +00:00
rustc_monomorphize Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrum 2025-02-09 15:44:16 +00:00
rustc_next_trait_solver adjust derive_error 2025-02-13 23:49:09 +01:00
rustc_parse Stop using span hack for contracts feature gating 2025-02-10 19:51:26 +00:00
rustc_parse_format Rustfmt 2025-02-08 22:12:13 +00:00
rustc_passes Rollup merge of #136833 - workingjubilee:let-the-impossible-be-impossible, r=compiler-errors 2025-02-11 18:04:44 +01:00
rustc_pattern_analysis
rustc_privacy
rustc_query_impl Removed dependency on the field-offset crate. 2025-02-05 17:56:06 +01:00
rustc_query_system Rollup merge of #136858 - safinaskar:parallel-cleanup-2025-02-11-07-54, r=SparrowLii 2025-02-13 03:53:31 -05:00
rustc_resolve Rollup merge of #136869 - chenyukang:yukang-fix-133713-let-binding, r=estebank 2025-02-13 17:46:08 -08:00
rustc_sanitizers
rustc_serialize
rustc_session Rollup merge of #135285 - tbu-:pr_fix_typo4, r=GuillaumeGomez 2025-02-11 18:04:22 +01:00
rustc_smir Auto merge of #136593 - lukas-code:ty-value-perf, r=oli-obk 2025-02-13 15:27:30 +00:00
rustc_span Auto merge of #136965 - jhpratt:rollup-bsnqvmf, r=jhpratt 2025-02-13 11:45:11 +00:00
rustc_symbol_mangling compiler: remove AbiDatas 2025-02-11 20:18:01 -08:00
rustc_target Rollup merge of #134999 - Berrysoft:dev/new-cygwin-target, r=chenyukang,workingjubilee 2025-02-13 03:53:28 -05:00
rustc_trait_selection adjust derive_error 2025-02-13 23:49:09 +01:00
rustc_traits
rustc_transmute transmutability: fix ICE when passing wrong ADT to ASSUME 2025-02-08 05:44:29 +01:00
rustc_ty_utils Auto merge of #136593 - lukas-code:ty-value-perf, r=oli-obk 2025-02-13 15:27:30 +00:00
rustc_type_ir normalizes-to rework rigid alias handling 2025-02-13 20:19:11 +00:00
rustc_type_ir_macros Rustfmt 2025-02-08 22:12:13 +00:00
stable_mir Extend the renaming to coerce_unsafe_ptr 2025-02-10 13:01:55 +00:00