@@ -857,12 +857,11 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
857857 place,
858858 } => {
859859 self . check_reg ( span, reg) ;
860- match place {
861- Some ( place) => Some ( OutRegister :: Place ( * place) ) ,
862- None => {
863- self . tcx . dcx ( ) . span_err ( span, "missing place for register" ) ;
864- None
865- }
860+ if let Some ( place) = place {
861+ Some ( OutRegister :: Place ( * place) )
862+ } else {
863+ self . tcx . dcx ( ) . span_err ( span, "missing place for register" ) ;
864+ None
866865 }
867866 }
868867 InlineAsmOperandRef :: InOut {
@@ -872,12 +871,11 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
872871 out_place,
873872 } => {
874873 self . check_reg ( span, reg) ;
875- match out_place {
876- Some ( out_place) => Some ( OutRegister :: Place ( * out_place) ) ,
877- None => {
878- self . tcx . dcx ( ) . span_err ( span, "missing place for register" ) ;
879- None
880- }
874+ if let Some ( out_place) = out_place {
875+ Some ( OutRegister :: Place ( * out_place) )
876+ } else {
877+ self . tcx . dcx ( ) . span_err ( span, "missing place for register" ) ;
878+ None
881879 }
882880 }
883881 InlineAsmOperandRef :: Const { string : _ } => {
@@ -953,8 +951,8 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
953951 place,
954952 } => {
955953 self . check_reg ( span, reg) ;
956- match place {
957- Some ( place ) => match self . lookup_type ( place. val . llval . ty ) {
954+ if let Some ( place ) = place {
955+ match self . lookup_type ( place. val . llval . ty ) {
958956 SpirvType :: Pointer { pointee } => Some ( pointee) ,
959957 other => {
960958 self . tcx . dcx ( ) . span_err (
@@ -966,13 +964,12 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
966964 ) ;
967965 None
968966 }
969- } ,
970- None => {
971- self . tcx
972- . dcx ( )
973- . span_err ( span, "missing place for out register typeof" ) ;
974- None
975967 }
968+ } else {
969+ self . tcx
970+ . dcx ( )
971+ . span_err ( span, "missing place for out register typeof" ) ;
972+ None
976973 }
977974 }
978975 InlineAsmOperandRef :: InOut {
0 commit comments