@@ -26,7 +26,6 @@ use rustc_codegen_ssa::traits::{
2626use rustc_data_structures:: fx:: FxHashSet ;
2727use rustc_middle:: bug;
2828use rustc_middle:: middle:: codegen_fn_attrs:: CodegenFnAttrs ;
29- use rustc_middle:: mir:: Rvalue ;
3029use rustc_middle:: ty:: { ParamEnv , Ty , TyCtxt } ;
3130use rustc_middle:: ty:: layout:: { FnAbiError , FnAbiOfHelpers , FnAbiRequest , HasParamEnv , HasTyCtxt , LayoutError , LayoutOfHelpers , TyAndLayout } ;
3231use rustc_span:: Span ;
@@ -401,9 +400,8 @@ impl<'gcc, 'tcx> BackendTypes for Builder<'_, 'gcc, 'tcx> {
401400
402401pub fn set_rval_location < ' a , ' gcc , ' tcx > ( bx : & mut Builder < ' a , ' gcc , ' tcx > , r : RValue < ' gcc > ) -> RValue < ' gcc > {
403402 if bx. loc . is_some ( ) {
404- unsafe {
405- r. set_location ( bx. loc . unwrap ( ) ) ;
406- }
403+ #[ cfg( feature = "master" ) ]
404+ r. set_location ( bx. loc . unwrap ( ) ) ;
407405 }
408406 r
409407
@@ -545,9 +543,8 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
545543 fn fmul ( & mut self , a : RValue < ' gcc > , b : RValue < ' gcc > ) -> RValue < ' gcc > {
546544 let i=a * b;
547545 if self . loc . is_some ( ) {
548- unsafe {
549- i. set_location ( self . loc . clone ( ) . unwrap ( ) ) ;
550- }
546+ #[ cfg( feature = "master" ) ]
547+ i. set_location ( self . loc . clone ( ) . unwrap ( ) ) ;
551548 }
552549 i
553550 }
@@ -666,7 +663,8 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
666663 let ret = self . cx . gcc_or ( a, b, self . loc ) ;
667664
668665 if self . loc . is_some ( ) {
669- unsafe { ret. set_location ( self . loc . unwrap ( ) ) ; }
666+ #[ cfg( feature = "master" ) ]
667+ ret. set_location ( self . loc . unwrap ( ) ) ;
670668 }
671669 ret
672670 }
0 commit comments