@@ -18,6 +18,7 @@ use rustc_data_structures::small_c_str::SmallCStr;
18
18
use rustc_hir:: def_id:: DefId ;
19
19
use rustc_middle:: ty:: layout:: TyAndLayout ;
20
20
use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
21
+ use rustc_span:: sym;
21
22
use rustc_target:: abi:: { self , Align , Size } ;
22
23
use rustc_target:: spec:: { HasTargetSpec , Target } ;
23
24
use std:: borrow:: Cow ;
@@ -478,7 +479,11 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
478
479
let llptr = self . struct_gep ( place. llval , i as u64 ) ;
479
480
let load = self . load ( llptr, align) ;
480
481
scalar_load_metadata ( self , load, scalar) ;
481
- if scalar. is_bool ( ) { self . trunc ( load, self . type_i1 ( ) ) } else { load }
482
+ if scalar. is_bool ( ) {
483
+ self . trunc ( load, self . type_i1 ( ) )
484
+ } else {
485
+ load
486
+ }
482
487
} ;
483
488
484
489
OperandValue :: Pair (
@@ -654,10 +659,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
654
659
655
660
fn fptoui_sat ( & mut self , val : & ' ll Value , dest_ty : & ' ll Type ) -> Option < & ' ll Value > {
656
661
if self . sess ( ) . target . target . arch == "wasm32"
657
- && self
658
- . sess ( )
659
- . target_features
660
- . contains ( & rustc_span:: symbol:: Symbol :: intern ( "nontrapping-fptoint" ) )
662
+ && self . sess ( ) . target_features . contains ( & sym:: wasm_nontrapping_fptoint)
661
663
{
662
664
let src_ty = self . cx . val_ty ( val) ;
663
665
let float_width = self . cx . float_width ( src_ty) ;
@@ -679,10 +681,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
679
681
680
682
fn fptosi_sat ( & mut self , val : & ' ll Value , dest_ty : & ' ll Type ) -> Option < & ' ll Value > {
681
683
if self . sess ( ) . target . target . arch == "wasm32"
682
- && self
683
- . sess ( )
684
- . target_features
685
- . contains ( & rustc_span:: symbol:: Symbol :: intern ( "nontrapping-fptoint" ) )
684
+ && self . sess ( ) . target_features . contains ( & sym:: wasm_nontrapping_fptoint)
686
685
{
687
686
let src_ty = self . cx . val_ty ( val) ;
688
687
let float_width = self . cx . float_width ( src_ty) ;
0 commit comments