Why -Zcombine-cgu option optimize out debug info?

Just found that when use -Zcombine-cgu in nightly build, the generated binary target lost debug info, and you can't debug any more.

But unlike -Copt-level or -Zmir-opt-level moving away debug info, -Zcombine-cgu should just increase cgu compiling speed and actually it really reduce compiling time a little bit.

Is it a way or workaround to use -Zcombine-cgu without lose debug capability?

Did you have debuginfo enabled in the first place? What is the exact command you used?

debuginfo was enabled by default in profile.dev, except combine-cgu implying it was disabled; but even manually enable it -Cdebuginfo=2 the binary still lack of debug info when enabling combine-cgu flag.

That seems like a bug. Could you open an issue?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.