rust/compiler/rustc_codegen_ssa/src
bors 4f0c568785 Auto merge of #87082 - michaelwoerister:const-in-debuginfo-type-names-fix, r=oli-obk,wesleywiser
Handle non-integer const generic parameters in debuginfo type names.

This PR fixes an ICE introduced by https://github.com/rust-lang/rust/pull/85269 which started emitting const generic arguments for debuginfo names but did not cover the case where such an argument could not be evaluated to a flat string of bits.

The fix implemented in this PR is very basic: If `try_eval_bits()` fails for the constant in question, we fall back to generating a stable hash of the constant and emit that instead. This way we get a (virtually) unique name and side step the problem of generating a string representation of a potentially complex value.

The downside is that the generated name will be rather opaque. E.g. the regression test adds a function `const_generic_fn_non_int<()>` which is then rendered as `const_generic_fn_non_int<{CONST#fe3cfa0214ac55c7}>`. I think it's an open question how to deal with this more gracefully.

I'd be interested in ideas on how to do this better.

r? `@wesleywiser`

cc `@dpaoliello` (do you see any problems with this approach?)
cc `@Mark-Simulacrum` & `@nagisa` (who I've seen comment on debuginfo issues recently -- anyone else?)

Fixes https://github.com/rust-lang/rust/issues/86893
2021-07-14 15:18:27 +00:00
..
back Add support for raw-dylib with stdcall, fastcall functions on i686-pc-windows-msvc. 2021-07-09 12:04:54 -07:00
coverageinfo Reland - Report coverage 0 of dead blocks 2021-06-01 13:28:59 -07:00
debuginfo Handle non-integer const generic parameters in debuginfo type names. 2021-07-14 15:55:03 +02:00
mir Don't access pointer element type for nontemporal store 2021-07-09 22:15:05 +02:00
traits Pass type when creating load 2021-07-09 22:14:44 +02:00
base.rs Auto merge of #86105 - bjorn3:link_info_refactor, r=petrochenkov 2021-07-07 18:28:53 +00:00
common.rs Remove support for floating-point constants in asm! 2021-05-14 14:58:21 +01:00
glue.rs Refactor to make interpreter and codegen backend neutral to vtable internal representation. 2021-06-15 01:59:00 +08:00
lib.rs Fold LinkerInfo into CrateInfo 2021-07-06 18:28:07 +02:00
meth.rs Pass type when creating load 2021-07-09 22:14:44 +02:00
mono_item.rs Add support for const operands and options to global_asm! 2021-05-13 22:31:57 +01:00
target_features.rs std: Stabilize wasm simd intrinsics 2021-06-10 19:42:05 -07:00