Tuple field names in debuginfo are prefixed with __
.
#106009
Labels
A-debuginfo
Area: Debugging information in compiled programs (DWARF, PDB, etc.)
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The DWARF debugging information entries for tuple field names (and for the field names of tuple-like structs and variants) are prefixed with
__
. For instance,Option
'sSome
variant is recorded as having a field named__0
, rather than0
.I think this is a little unfortunate. Tuple indices behave quite like field names in Rust, insofar that they're accessed with
.
and that you can instantiate tuple-like structs and variants as if they are records; e.g.:It's odd, then, that these fields would not appear in a debugger as they would in Rust.
My own stake in this is deflect, allows you to get fields by name from structs and variants. Users reflecting on tuple-like structs and variants must know to prefix their queries with
__
, and the pretty-printer and serializers provided bydeflect
cannot generally strip away the__
from field names.The text was updated successfully, but these errors were encountered: