@@ -92,7 +92,7 @@ fn gen_instruction_data(formats: &[Rc<InstructionFormat>], fmt: &mut Formatter)
92
92
"blocks: [ir::BlockCall; {}]," ,
93
93
format. num_block_operands
94
94
) ,
95
- n => panic ! ( "Too many block operands in instruction: {}" , n ) ,
95
+ n => panic ! ( "Too many block operands in instruction: {n}" ) ,
96
96
}
97
97
98
98
for field in & format. imm_fields {
@@ -137,21 +137,21 @@ fn gen_arguments_method(formats: &[Rc<InstructionFormat>], fmt: &mut Formatter,
137
137
m. arm (
138
138
name,
139
139
vec ! [ format!( "ref {}args" , mut_) , ".." . to_string( ) ] ,
140
- format ! ( "args.{}(pool)" , as_slice ) ,
140
+ format ! ( "args.{as_slice }(pool)" ) ,
141
141
) ;
142
142
continue ;
143
143
}
144
144
145
145
// Fixed args.
146
146
let mut fields = Vec :: new ( ) ;
147
147
let arg = if format. num_value_operands == 0 {
148
- format ! ( "&{}[]" , mut_ )
148
+ format ! ( "&{mut_ }[]" )
149
149
} else if format. num_value_operands == 1 {
150
- fields. push ( format ! ( "ref {}arg" , mut_ ) ) ;
151
- format ! ( "{}(arg)" , rslice )
150
+ fields. push ( format ! ( "ref {mut_ }arg" ) ) ;
151
+ format ! ( "{rslice }(arg)" )
152
152
} else {
153
153
let arg = format ! ( "args_arity{}" , format. num_value_operands) ;
154
- fields. push ( format ! ( "args: ref {}{}" , mut_ , arg ) ) ;
154
+ fields. push ( format ! ( "args: ref {mut_}{arg}" ) ) ;
155
155
arg
156
156
} ;
157
157
fields. push ( ".." . into ( ) ) ;
@@ -277,8 +277,8 @@ fn gen_instruction_data_impl(formats: &[Rc<InstructionFormat>], fmt: &mut Format
277
277
members. push ( field. member ) ;
278
278
}
279
279
280
- let pat1 = members. iter ( ) . map ( |x| format ! ( "{}: ref {}1" , x , x ) ) . collect :: < Vec < _ > > ( ) . join ( ", " ) ;
281
- let pat2 = members. iter ( ) . map ( |x| format ! ( "{}: ref {}2" , x , x ) ) . collect :: < Vec < _ > > ( ) . join ( ", " ) ;
280
+ let pat1 = members. iter ( ) . map ( |x| format ! ( "{x }: ref {x }1" ) ) . collect :: < Vec < _ > > ( ) . join ( ", " ) ;
281
+ let pat2 = members. iter ( ) . map ( |x| format ! ( "{x }: ref {x }2" ) ) . collect :: < Vec < _ > > ( ) . join ( ", " ) ;
282
282
fmtln ! ( fmt, "({} {{ {} }}, {} {{ {} }}) => {{" , name, pat1, name, pat2) ;
283
283
fmt. indent ( |fmt| {
284
284
fmt. line ( "opcode1 == opcode2" ) ;
@@ -734,7 +734,7 @@ fn iterable_to_string<I: fmt::Display, T: IntoIterator<Item = I>>(iterable: T) -
734
734
. map ( |x| x. to_string ( ) )
735
735
. collect :: < Vec < _ > > ( )
736
736
. join ( ", " ) ;
737
- format ! ( "{{{}}}" , elems )
737
+ format ! ( "{{{elems }}}" )
738
738
}
739
739
740
740
fn typeset_to_string ( ts : & TypeSet ) -> String {
@@ -853,7 +853,7 @@ fn gen_type_constraints(all_inst: &AllInstructions, fmt: &mut Formatter) {
853
853
) ;
854
854
fmt. comment ( format ! ( "Constraints=[{}]" , constraints
855
855
. iter( )
856
- . map( |x| format!( "'{}'" , x ) )
856
+ . map( |x| format!( "'{x }'" ) )
857
857
. collect:: <Vec <_>>( )
858
858
. join( ", " ) ) ) ;
859
859
if let Some ( poly) = & inst. polymorphic_info {
@@ -916,7 +916,7 @@ fn gen_member_inits(format: &InstructionFormat, fmt: &mut Formatter) {
916
916
} else if format. num_value_operands > 1 {
917
917
let mut args = Vec :: new ( ) ;
918
918
for i in 0 ..format. num_value_operands {
919
- args. push ( format ! ( "arg{}" , i ) ) ;
919
+ args. push ( format ! ( "arg{i}" ) ) ;
920
920
}
921
921
fmtln ! ( fmt, "args: [{}]," , args. join( ", " ) ) ;
922
922
}
@@ -928,7 +928,7 @@ fn gen_member_inits(format: &InstructionFormat, fmt: &mut Formatter) {
928
928
n => {
929
929
let mut blocks = Vec :: new ( ) ;
930
930
for i in 0 ..n {
931
- blocks. push ( format ! ( "block{}" , i ) ) ;
931
+ blocks. push ( format ! ( "block{i}" ) ) ;
932
932
}
933
933
fmtln ! ( fmt, "blocks: [{}]," , blocks. join( ", " ) ) ;
934
934
}
@@ -953,7 +953,7 @@ fn gen_format_constructor(format: &InstructionFormat, fmt: &mut Formatter) {
953
953
}
954
954
955
955
// Then the block operands.
956
- args. extend ( ( 0 ..format. num_block_operands ) . map ( |i| format ! ( "block{}: ir::BlockCall" , i ) ) ) ;
956
+ args. extend ( ( 0 ..format. num_block_operands ) . map ( |i| format ! ( "block{i }: ir::BlockCall" ) ) ) ;
957
957
958
958
// Then the value operands.
959
959
if format. has_value_list {
@@ -963,7 +963,7 @@ fn gen_format_constructor(format: &InstructionFormat, fmt: &mut Formatter) {
963
963
} else {
964
964
// Take a fixed number of value operands.
965
965
for i in 0 ..format. num_value_operands {
966
- args. push ( format ! ( "arg{}: Value" , i ) ) ;
966
+ args. push ( format ! ( "arg{i }: Value" ) ) ;
967
967
}
968
968
}
969
969
@@ -1000,7 +1000,7 @@ fn gen_format_constructor(format: &InstructionFormat, fmt: &mut Formatter) {
1000
1000
}
1001
1001
1002
1002
// Assert that this opcode belongs to this format
1003
- fmtln ! ( fmt, "debug_assert_eq!(opcode.format(), InstructionFormat::from(&data), \" Wrong InstructionFormat for Opcode: {}\" , opcode );" ) ;
1003
+ fmtln ! ( fmt, "debug_assert_eq!(opcode.format(), InstructionFormat::from(&data), \" Wrong InstructionFormat for Opcode: {opcode }\" );" ) ;
1004
1004
1005
1005
fmt. line ( "self.build(data, ctrl_typevar)" ) ;
1006
1006
} ) ;
@@ -1202,7 +1202,7 @@ fn gen_inst_builder(inst: &Instruction, format: &InstructionFormat, fmt: &mut Fo
1202
1202
inst. value_results
1203
1203
. iter( )
1204
1204
. enumerate( )
1205
- . map( |( i, _) | format!( "results[{}]" , i ) )
1205
+ . map( |( i, _) | format!( "results[{i }]" ) )
1206
1206
. collect:: <Vec <_>>( )
1207
1207
. join( ", " )
1208
1208
) ;
0 commit comments