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?