From 2adf2cd2f743e13d79fd4669bd6f673023a243f2 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Wed, 15 Mar 2023 18:01:37 +0100 Subject: [PATCH] Account for debuginfo on _0 without naming it. --- compiler/rustc_codegen_ssa/src/mir/debuginfo.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs b/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs index dd39c6468e55d..6e32c28a42c65 100644 --- a/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs +++ b/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs @@ -241,11 +241,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { pub fn debug_introduce_local(&self, bx: &mut Bx, local: mir::Local) { let full_debug_info = bx.sess().opts.debuginfo == DebugInfo::Full; - // FIXME(eddyb) maybe name the return place as `_0` or `return`? - if local == mir::RETURN_PLACE { - return; - } - let vars = match &self.per_local_var_debug_info { Some(per_local) => &per_local[local], None => return, @@ -302,7 +297,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { let local_ref = &self.locals[local]; - let name = if bx.sess().fewer_names() { + // FIXME Should the return place be named? + let name = if bx.sess().fewer_names() || local == mir::RETURN_PLACE { None } else { Some(match whole_local_var.or(fallback_var.clone()) {