diff --git a/compiler/rustc_codegen_gcc/src/builder.rs b/compiler/rustc_codegen_gcc/src/builder.rs index c0519f7a68e28..1787415b72e6d 100644 --- a/compiler/rustc_codegen_gcc/src/builder.rs +++ b/compiler/rustc_codegen_gcc/src/builder.rs @@ -503,9 +503,9 @@ fn set_rvalue_location<'a, 'gcc, 'tcx>( bx: &mut Builder<'a, 'gcc, 'tcx>, rvalue: RValue<'gcc>, ) -> RValue<'gcc> { - if bx.location.is_some() { + if let Some(location) = bx.location { #[cfg(feature = "master")] - rvalue.set_location(bx.location.unwrap()); + rvalue.set_location(location); } rvalue }