@@ -857,12 +857,11 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
857
857
place,
858
858
} => {
859
859
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
866
865
}
867
866
}
868
867
InlineAsmOperandRef :: InOut {
@@ -872,12 +871,11 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
872
871
out_place,
873
872
} => {
874
873
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
881
879
}
882
880
}
883
881
InlineAsmOperandRef :: Const { string : _ } => {
@@ -953,8 +951,8 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
953
951
place,
954
952
} => {
955
953
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 ) {
958
956
SpirvType :: Pointer { pointee } => Some ( pointee) ,
959
957
other => {
960
958
self . tcx . dcx ( ) . span_err (
@@ -966,13 +964,12 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
966
964
) ;
967
965
None
968
966
}
969
- } ,
970
- None => {
971
- self . tcx
972
- . dcx ( )
973
- . span_err ( span, "missing place for out register typeof" ) ;
974
- None
975
967
}
968
+ } else {
969
+ self . tcx
970
+ . dcx ( )
971
+ . span_err ( span, "missing place for out register typeof" ) ;
972
+ None
976
973
}
977
974
}
978
975
InlineAsmOperandRef :: InOut {
0 commit comments