Skip to content

Commit b7eaae1

Browse files
committed
Keep inlined var_debug_info only when full debug info is used
1 parent e43a00e commit b7eaae1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/rustc_mir_transform/src/inline.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -987,9 +987,10 @@ fn inline_call<'tcx, I: Inliner<'tcx>>(
987987
.opts
988988
.unstable_opts
989989
.inline_mir_preserve_debug
990-
.unwrap_or(tcx.sess.opts.debuginfo != DebugInfo::None)
990+
// only "full" promises any variable-level information
991+
.unwrap_or(self.opts.debuginfo == DebugInfo::Full)
991992
{
992-
// Note that we need to preserve these in the standard library so that
993+
// -Zinline-mir-preserve-debug is enabled when building the standard library, so that
993994
// people working on rust can build with or without debuginfo while
994995
// still getting consistent results from the mir-opt tests.
995996
caller_body.var_debug_info.append(&mut callee_body.var_debug_info);

0 commit comments

Comments
 (0)