@@ -193,8 +193,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
193
193
. constant_u64 ( self . span ( ) , memset_fill_u64 ( fill_byte) )
194
194
. def ( self ) ,
195
195
_ => self . fatal ( & format ! (
196
- "memset on integer width {} not implemented yet" ,
197
- width
196
+ "memset on integer width {width} not implemented yet"
198
197
) ) ,
199
198
} ,
200
199
SpirvType :: Float ( width) => match width {
@@ -205,8 +204,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
205
204
. constant_f64 ( self . span ( ) , f64:: from_bits ( memset_fill_u64 ( fill_byte) ) )
206
205
. def ( self ) ,
207
206
_ => self . fatal ( & format ! (
208
- "memset on float width {} not implemented yet" ,
209
- width
207
+ "memset on float width {width} not implemented yet"
210
208
) ) ,
211
209
} ,
212
210
SpirvType :: Adt { .. } => self . fatal ( "memset on structs not implemented yet" ) ,
@@ -253,16 +251,14 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
253
251
32 => memset_dynamic_scalar ( self , fill_var, 4 , false ) ,
254
252
64 => memset_dynamic_scalar ( self , fill_var, 8 , false ) ,
255
253
_ => self . fatal ( & format ! (
256
- "memset on integer width {} not implemented yet" ,
257
- width
254
+ "memset on integer width {width} not implemented yet"
258
255
) ) ,
259
256
} ,
260
257
SpirvType :: Float ( width) => match width {
261
258
32 => memset_dynamic_scalar ( self , fill_var, 4 , true ) ,
262
259
64 => memset_dynamic_scalar ( self , fill_var, 8 , true ) ,
263
260
_ => self . fatal ( & format ! (
264
- "memset on float width {} not implemented yet" ,
265
- width
261
+ "memset on float width {width} not implemented yet"
266
262
) ) ,
267
263
} ,
268
264
SpirvType :: Adt { .. } => self . fatal ( "memset on structs not implemented yet" ) ,
@@ -367,7 +363,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
367
363
if !self . builder . has_capability ( Capability :: VariablePointers ) {
368
364
self . zombie (
369
365
def,
370
- & format ! ( "{} without OpCapability VariablePointers" , inst ) ,
366
+ & format ! ( "{inst } without OpCapability VariablePointers" ) ,
371
367
) ;
372
368
}
373
369
}
@@ -725,8 +721,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
725
721
fn construct_8 ( self_ : & Builder < ' _ , ' _ > , signed : bool , v : u128 ) -> Operand {
726
722
if v > u8:: MAX as u128 {
727
723
self_. fatal ( & format ! (
728
- "Switches to values above u8::MAX not supported: {:?}" ,
729
- v
724
+ "Switches to values above u8::MAX not supported: {v:?}"
730
725
) )
731
726
} else if signed {
732
727
// this cast chain can probably be collapsed, but, whatever, be safe
@@ -738,8 +733,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
738
733
fn construct_16 ( self_ : & Builder < ' _ , ' _ > , signed : bool , v : u128 ) -> Operand {
739
734
if v > u16:: MAX as u128 {
740
735
self_. fatal ( & format ! (
741
- "Switches to values above u16::MAX not supported: {:?}" ,
742
- v
736
+ "Switches to values above u16::MAX not supported: {v:?}"
743
737
) )
744
738
} else if signed {
745
739
Operand :: LiteralInt32 ( v as u16 as i16 as i32 as u32 )
@@ -750,8 +744,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
750
744
fn construct_32 ( self_ : & Builder < ' _ , ' _ > , _signed : bool , v : u128 ) -> Operand {
751
745
if v > u32:: MAX as u128 {
752
746
self_. fatal ( & format ! (
753
- "Switches to values above u32::MAX not supported: {:?}" ,
754
- v
747
+ "Switches to values above u32::MAX not supported: {v:?}"
755
748
) )
756
749
} else {
757
750
Operand :: LiteralInt32 ( v as u32 )
@@ -760,8 +753,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
760
753
fn construct_64 ( self_ : & Builder < ' _ , ' _ > , _signed : bool , v : u128 ) -> Operand {
761
754
if v > u64:: MAX as u128 {
762
755
self_. fatal ( & format ! (
763
- "Switches to values above u64::MAX not supported: {:?}" ,
764
- v
756
+ "Switches to values above u64::MAX not supported: {v:?}"
765
757
) )
766
758
} else {
767
759
Operand :: LiteralInt64 ( v as u64 )
@@ -776,8 +768,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
776
768
32 => construct_32,
777
769
64 => construct_64,
778
770
other => self . fatal ( & format ! (
779
- "switch selector cannot have width {} (only 8, 16, 32, and 64 bits allowed)" ,
780
- other
771
+ "switch selector cannot have width {other} (only 8, 16, 32, and 64 bits allowed)"
781
772
) ) ,
782
773
} ;
783
774
( signed, construct_case)
@@ -1025,8 +1016,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
1025
1016
pointee
1026
1017
}
1027
1018
ty => self . fatal ( & format ! (
1028
- "load called on variable that wasn't a pointer: {:?}" ,
1029
- ty
1019
+ "load called on variable that wasn't a pointer: {ty:?}"
1030
1020
) ) ,
1031
1021
} ;
1032
1022
self . emit ( )
@@ -1055,8 +1045,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
1055
1045
pointee
1056
1046
}
1057
1047
ty => self . fatal ( & format ! (
1058
- "atomic_load called on variable that wasn't a pointer: {:?}" ,
1059
- ty
1048
+ "atomic_load called on variable that wasn't a pointer: {ty:?}"
1060
1049
) ) ,
1061
1050
} ;
1062
1051
// TODO: Default to device scope
@@ -1135,7 +1124,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
1135
1124
let start = dest. project_index ( self , zero) . llval ;
1136
1125
1137
1126
let elem_layout = dest. layout . field ( self . cx ( ) , 0 ) ;
1138
- let elem_ty = elem_layout. spirv_type ( self . span ( ) , & self ) ;
1127
+ let elem_ty = elem_layout. spirv_type ( self . span ( ) , self ) ;
1139
1128
let align = dest. align . restrict_for_offset ( elem_layout. size ) ;
1140
1129
1141
1130
for i in 0 ..count {
@@ -1159,8 +1148,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
1159
1148
let ptr_elem_ty = match self . lookup_type ( ptr. ty ) {
1160
1149
SpirvType :: Pointer { pointee } => pointee,
1161
1150
ty => self . fatal ( & format ! (
1162
- "store called on variable that wasn't a pointer: {:?}" ,
1163
- ty
1151
+ "store called on variable that wasn't a pointer: {ty:?}"
1164
1152
) ) ,
1165
1153
} ;
1166
1154
@@ -1192,8 +1180,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
1192
1180
) -> Self :: Value {
1193
1181
if flags != MemFlags :: empty ( ) {
1194
1182
self . err ( & format ! (
1195
- "store_with_flags is not supported yet: {:?}" ,
1196
- flags
1183
+ "store_with_flags is not supported yet: {flags:?}"
1197
1184
) ) ;
1198
1185
}
1199
1186
self . store ( val, ptr, align)
@@ -1209,8 +1196,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
1209
1196
let ptr_elem_ty = match self . lookup_type ( ptr. ty ) {
1210
1197
SpirvType :: Pointer { pointee } => pointee,
1211
1198
ty => self . fatal ( & format ! (
1212
- "atomic_store called on variable that wasn't a pointer: {:?}" ,
1213
- ty
1199
+ "atomic_store called on variable that wasn't a pointer: {ty:?}"
1214
1200
) ) ,
1215
1201
} ;
1216
1202
assert_ty_eq ! ( self , ptr_elem_ty, val. ty) ;
@@ -1248,8 +1234,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
1248
1234
pointee
1249
1235
}
1250
1236
other => self . fatal ( & format ! (
1251
- "struct_gep not on pointer type: {:?}, index {}" ,
1252
- other, idx
1237
+ "struct_gep not on pointer type: {other:?}, index {idx}"
1253
1238
) ) ,
1254
1239
} ;
1255
1240
let pointee_kind = self . lookup_type ( pointee) ;
@@ -1264,8 +1249,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
1264
1249
inner_type
1265
1250
}
1266
1251
other => self . fatal ( & format ! (
1267
- "struct_gep not on struct, array, or vector type: {:?}, index {}" ,
1268
- other, idx
1252
+ "struct_gep not on struct, array, or vector type: {other:?}, index {idx}"
1269
1253
) ) ,
1270
1254
} ;
1271
1255
let result_type = SpirvType :: Pointer {
@@ -1410,8 +1394,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
1410
1394
match self . lookup_type ( val. ty ) {
1411
1395
SpirvType :: Pointer { .. } => ( ) ,
1412
1396
other => self . fatal ( & format ! (
1413
- "ptrtoint called on non-pointer source type: {:?}" ,
1414
- other
1397
+ "ptrtoint called on non-pointer source type: {other:?}"
1415
1398
) ) ,
1416
1399
}
1417
1400
if val. ty == dest_ty {
@@ -1431,8 +1414,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
1431
1414
match self . lookup_type ( dest_ty) {
1432
1415
SpirvType :: Pointer { .. } => ( ) ,
1433
1416
other => self . fatal ( & format ! (
1434
- "inttoptr called on non-pointer dest type: {:?}" ,
1435
- other
1417
+ "inttoptr called on non-pointer dest type: {other:?}"
1436
1418
) ) ,
1437
1419
}
1438
1420
if val. ty == dest_ty {
@@ -1540,8 +1522,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
1540
1522
. with_type ( dest_ty)
1541
1523
}
1542
1524
( val_ty, dest_ty_spv) => self . fatal ( & format ! (
1543
- "TODO: intcast not implemented yet: val={:?} val.ty={:?} dest_ty={:?} is_signed={}" ,
1544
- val, val_ty, dest_ty_spv, is_signed
1525
+ "TODO: intcast not implemented yet: val={val:?} val.ty={val_ty:?} dest_ty={dest_ty_spv:?} is_signed={is_signed}"
1545
1526
) ) ,
1546
1527
}
1547
1528
}
@@ -1566,16 +1547,14 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
1566
1547
_ => match self . lookup_type ( val. ty ) {
1567
1548
SpirvType :: Pointer { pointee } => ( val, pointee) ,
1568
1549
other => self . fatal ( & format ! (
1569
- "pointercast called on non-pointer source type: {:?}" ,
1570
- other
1550
+ "pointercast called on non-pointer source type: {other:?}"
1571
1551
) ) ,
1572
1552
} ,
1573
1553
} ;
1574
1554
let dest_pointee = match self . lookup_type ( dest_ty) {
1575
1555
SpirvType :: Pointer { pointee } => pointee,
1576
1556
other => self . fatal ( & format ! (
1577
- "pointercast called on non-pointer dest type: {:?}" ,
1578
- other
1557
+ "pointercast called on non-pointer dest type: {other:?}"
1579
1558
) ) ,
1580
1559
} ;
1581
1560
if val. ty == dest_ty {
@@ -1869,8 +1848,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
1869
1848
) {
1870
1849
if flags != MemFlags :: empty ( ) {
1871
1850
self . err ( & format ! (
1872
- "memcpy with mem flags is not supported yet: {:?}" ,
1873
- flags
1851
+ "memcpy with mem flags is not supported yet: {flags:?}"
1874
1852
) ) ;
1875
1853
}
1876
1854
let const_size = self . builder . lookup_const_u64 ( size) ;
@@ -1928,8 +1906,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
1928
1906
) {
1929
1907
if flags != MemFlags :: empty ( ) {
1930
1908
self . err ( & format ! (
1931
- "memset with mem flags is not supported yet: {:?}" ,
1932
- flags
1909
+ "memset with mem flags is not supported yet: {flags:?}"
1933
1910
) ) ;
1934
1911
}
1935
1912
let elem_ty = match self . lookup_type ( ptr. ty ) {
@@ -1979,8 +1956,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
1979
1956
let result_type = match self . lookup_type ( vec. ty ) {
1980
1957
SpirvType :: Vector { element, .. } => element,
1981
1958
other => self . fatal ( & format ! (
1982
- "extract_element not implemented on type {:?}" ,
1983
- other
1959
+ "extract_element not implemented on type {other:?}"
1984
1960
) ) ,
1985
1961
} ;
1986
1962
match self . builder . lookup_const_u64 ( idx) {
@@ -2046,7 +2022,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
2046
2022
SpirvType :: Adt { field_types, .. } => {
2047
2023
assert_ty_eq ! ( self , field_types[ idx as usize ] , elt. ty) ;
2048
2024
}
2049
- other => self . fatal ( & format ! ( "insert_value not implemented on type {:?}" , other ) ) ,
2025
+ other => self . fatal ( & format ! ( "insert_value not implemented on type {other :?}" ) ) ,
2050
2026
} ;
2051
2027
self . emit ( )
2052
2028
. composite_insert (
@@ -2111,8 +2087,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
2111
2087
let dst_pointee_ty = match self . lookup_type ( dst. ty ) {
2112
2088
SpirvType :: Pointer { pointee } => pointee,
2113
2089
ty => self . fatal ( & format ! (
2114
- "atomic_cmpxchg called on variable that wasn't a pointer: {:?}" ,
2115
- ty
2090
+ "atomic_cmpxchg called on variable that wasn't a pointer: {ty:?}"
2116
2091
) ) ,
2117
2092
} ;
2118
2093
assert_ty_eq ! ( self , dst_pointee_ty, cmp. ty) ;
@@ -2148,8 +2123,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
2148
2123
let dst_pointee_ty = match self . lookup_type ( dst. ty ) {
2149
2124
SpirvType :: Pointer { pointee } => pointee,
2150
2125
ty => self . fatal ( & format ! (
2151
- "atomic_rmw called on variable that wasn't a pointer: {:?}" ,
2152
- ty
2126
+ "atomic_rmw called on variable that wasn't a pointer: {ty:?}"
2153
2127
) ) ,
2154
2128
} ;
2155
2129
assert_ty_eq ! ( self , dst_pointee_ty, src. ty) ;
0 commit comments