DWARF info for static vars in lib crates has stopped being produced reliably in LTO builds (original) (raw)

As of the 2021-09-23 nightly, rustc has stopped producing debug output for variables in a specific combination of circumstances:

We noticed this after bumping past 09-23 to the 2021-10-27 nightly, when our debugger broke. The static is still being included in the ELF output (both allocated space, and represented correctly in the symtab), but is missing from DWARF. Bisecting indicates 2021-09-23 as the culprit (09-22 works).

Here is a repro case that I've reduced that works on linux x86-64, at least, and probably other DWARF platforms.

https://github.com/cbiffle/rustc-dwarf-regression-repro

@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged