@@ -26,7 +26,6 @@ use rustc_codegen_ssa::traits::{
26
26
use rustc_data_structures:: fx:: FxHashSet ;
27
27
use rustc_middle:: bug;
28
28
use rustc_middle:: middle:: codegen_fn_attrs:: CodegenFnAttrs ;
29
- use rustc_middle:: mir:: Rvalue ;
30
29
use rustc_middle:: ty:: { ParamEnv , Ty , TyCtxt } ;
31
30
use rustc_middle:: ty:: layout:: { FnAbiError , FnAbiOfHelpers , FnAbiRequest , HasParamEnv , HasTyCtxt , LayoutError , LayoutOfHelpers , TyAndLayout } ;
32
31
use rustc_span:: Span ;
@@ -401,9 +400,8 @@ impl<'gcc, 'tcx> BackendTypes for Builder<'_, 'gcc, 'tcx> {
401
400
402
401
pub fn set_rval_location < ' a , ' gcc , ' tcx > ( bx : & mut Builder < ' a , ' gcc , ' tcx > , r : RValue < ' gcc > ) -> RValue < ' gcc > {
403
402
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 ( ) ) ;
407
405
}
408
406
r
409
407
@@ -545,9 +543,8 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
545
543
fn fmul ( & mut self , a : RValue < ' gcc > , b : RValue < ' gcc > ) -> RValue < ' gcc > {
546
544
let i=a * b;
547
545
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 ( ) ) ;
551
548
}
552
549
i
553
550
}
@@ -666,7 +663,8 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
666
663
let ret = self . cx . gcc_or ( a, b, self . loc ) ;
667
664
668
665
if self . loc . is_some ( ) {
669
- unsafe { ret. set_location ( self . loc . unwrap ( ) ) ; }
666
+ #[ cfg( feature = "master" ) ]
667
+ ret. set_location ( self . loc . unwrap ( ) ) ;
670
668
}
671
669
ret
672
670
}
0 commit comments