@@ -18,6 +18,7 @@ use rustc_data_structures::small_c_str::SmallCStr;
1818use rustc_hir:: def_id:: DefId ;
1919use rustc_middle:: ty:: layout:: TyAndLayout ;
2020use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
21+ use rustc_span:: sym;
2122use rustc_target:: abi:: { self , Align , Size } ;
2223use rustc_target:: spec:: { HasTargetSpec , Target } ;
2324use std:: borrow:: Cow ;
@@ -478,7 +479,11 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
478479 let llptr = self . struct_gep ( place. llval , i as u64 ) ;
479480 let load = self . load ( llptr, align) ;
480481 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+ }
482487 } ;
483488
484489 OperandValue :: Pair (
@@ -654,10 +659,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
654659
655660 fn fptoui_sat ( & mut self , val : & ' ll Value , dest_ty : & ' ll Type ) -> Option < & ' ll Value > {
656661 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)
661663 {
662664 let src_ty = self . cx . val_ty ( val) ;
663665 let float_width = self . cx . float_width ( src_ty) ;
@@ -679,10 +681,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
679681
680682 fn fptosi_sat ( & mut self , val : & ' ll Value , dest_ty : & ' ll Type ) -> Option < & ' ll Value > {
681683 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)
686685 {
687686 let src_ty = self . cx . val_ty ( val) ;
688687 let float_width = self . cx . float_width ( src_ty) ;
0 commit comments