about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-07-14 15:18:27 +0000
committerbors <bors@rust-lang.org>2021-07-14 15:18:27 +0000
commit4f0c568785adcc0a123cac9d47047020b7a24821 (patch)
tree7704ab1d6b9254cc08fae581401373279aaa1548 /src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parentee5ed4a88d6a869cdb152829ed697d6459650db3 (diff)
parent28343be42fc699c080968c76061fc2da781b30b9 (diff)
downloadrust-4f0c568785adcc0a123cac9d47047020b7a24821.tar.gz
rust-4f0c568785adcc0a123cac9d47047020b7a24821.zip
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
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions