debuginfo: give unique names to closure and generator types by philipc · Pull Request #63875 · rust-lang/rust (original) (raw)
Closure types have been moved to the namespace where they
are defined, and both closure and generator type names now
include the disambiguator.
This fixes an exception when lldb prints nested closures.
Fixes #57822
I haven't included the DW_AT_artificial
changes discussed in #57822 because they make the output worse IMO, but I can easily add these if still required. For example, for the new test case the output is now:
(lldb) p g
(issue_57822::main::closure-1) $1 = closure-1(closure(1))
but adding DW_AT_artificial
changes this to:
(lldb) p g
(issue_57822::main::closure-1) $0 = closure-1 {
}
Note that nested generators didn't cause the exception. I haven't determined why, but I think it makes sense to add the disambiguator for them too. It feels like we still don't really understand why closures were causing an error though.