@@ -36,7 +36,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
3636 let intrinsic_name = this. tcx . item_name ( instance. def_id ( ) ) ;
3737 let intrinsic_name = intrinsic_name. as_str ( ) ;
3838 let ret = match ret {
39- None => throw_unsup_format ! ( "unimplemented (diverging) intrinsic: {}" , intrinsic_name ) ,
39+ None => throw_unsup_format ! ( "unimplemented (diverging) intrinsic: `{intrinsic_name}`" ) ,
4040 Some ( p) => p,
4141 } ;
4242
@@ -86,7 +86,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
8686 // `checked_mul` enforces a too small bound (the correct one would probably be machine_isize_max),
8787 // but no actual allocation can be big enough for the difference to be noticeable.
8888 let byte_count = ty_layout. size . checked_mul ( count, this) . ok_or_else ( || {
89- err_ub_format ! ( "overflow computing total size of `{}`" , intrinsic_name )
89+ err_ub_format ! ( "overflow computing total size of `{intrinsic_name }`" )
9090 } ) ?;
9191 this. write_bytes_ptr (
9292 ptr,
@@ -200,24 +200,20 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
200200 ty:: Float ( FloatTy :: F32 ) => x. to_scalar ( ) ?. to_f32 ( ) ?. is_finite ( ) ,
201201 ty:: Float ( FloatTy :: F64 ) => x. to_scalar ( ) ?. to_f64 ( ) ?. is_finite ( ) ,
202202 _ => bug ! (
203- "`{}` called with non-float input type {:?}" ,
204- intrinsic_name,
205- x. layout. ty
203+ "`{intrinsic_name}` called with non-float input type {ty:?}" ,
204+ ty = x. layout. ty,
206205 ) ,
207206 } )
208207 } ;
209208 match ( float_finite ( a) ?, float_finite ( b) ?) {
210209 ( false , false ) => throw_ub_format ! (
211- "`{}` intrinsic called with non-finite value as both parameters" ,
212- intrinsic_name,
210+ "`{intrinsic_name}` intrinsic called with non-finite value as both parameters" ,
213211 ) ,
214212 ( false , _) => throw_ub_format ! (
215- "`{}` intrinsic called with non-finite value as first parameter" ,
216- intrinsic_name,
213+ "`{intrinsic_name}` intrinsic called with non-finite value as first parameter" ,
217214 ) ,
218215 ( _, false ) => throw_ub_format ! (
219- "`{}` intrinsic called with non-finite value as second parameter" ,
220- intrinsic_name,
216+ "`{intrinsic_name}` intrinsic called with non-finite value as second parameter" ,
221217 ) ,
222218 _ => { }
223219 }
@@ -494,7 +490,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
494490 // See <https://github.com/rust-lang/rust/issues/91237>.
495491 if overflowed {
496492 let r_val = right. to_scalar ( ) ?. to_bits ( right. layout . size ) ?;
497- throw_ub_format ! ( "overflowing shift by {} in `{}` in SIMD lane {}" , r_val , intrinsic_name , i ) ;
493+ throw_ub_format ! ( "overflowing shift by {r_val } in `{intrinsic_name }` in SIMD lane {i}" ) ;
498494 }
499495 }
500496 if matches ! ( mir_op, BinOp :: Eq | BinOp :: Ne | BinOp :: Lt | BinOp :: Le | BinOp :: Gt | BinOp :: Ge ) {
@@ -751,9 +747,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
751747 this. float_to_int_unchecked ( op. to_scalar ( ) ?. to_f64 ( ) ?, dest. layout . ty ) ?. into ( ) ,
752748 _ =>
753749 throw_unsup_format ! (
754- "Unsupported SIMD cast from element type {} to {}" ,
755- op. layout. ty,
756- dest. layout. ty
750+ "Unsupported SIMD cast from element type {from_ty } to {to_ty }" ,
751+ from_ty = op. layout. ty,
752+ to_ty = dest. layout. ty,
757753 ) ,
758754 } ;
759755 this. write_immediate ( val, & dest. into ( ) ) ?;
@@ -1093,7 +1089,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
10931089 throw_machine_stop ! ( TerminationInfo :: Abort ( "Trace/breakpoint trap" . to_string( ) ) )
10941090 }
10951091
1096- name => throw_unsup_format ! ( "unimplemented intrinsic: {}" , name ) ,
1092+ name => throw_unsup_format ! ( "unimplemented intrinsic: `{name}`" ) ,
10971093 }
10981094
10991095 trace ! ( "{:?}" , this. dump_place( * * dest) ) ;
@@ -1340,9 +1336,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
13401336 } else {
13411337 // `f` was not representable in this integer type.
13421338 throw_ub_format ! (
1343- "`float_to_int_unchecked` intrinsic called on {} which cannot be represented in target type `{:?}`" ,
1344- f,
1345- dest_ty,
1339+ "`float_to_int_unchecked` intrinsic called on {f} which cannot be represented in target type `{dest_ty:?}`" ,
13461340 ) ;
13471341 }
13481342 }
@@ -1356,14 +1350,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
13561350 } else {
13571351 // `f` was not representable in this integer type.
13581352 throw_ub_format ! (
1359- "`float_to_int_unchecked` intrinsic called on {} which cannot be represented in target type `{:?}`" ,
1360- f,
1361- dest_ty,
1353+ "`float_to_int_unchecked` intrinsic called on {f} which cannot be represented in target type `{dest_ty:?}`" ,
13621354 ) ;
13631355 }
13641356 }
13651357 // Nothing else
1366- _ => bug ! ( "`float_to_int_unchecked` called with non-int output type {:?}" , dest_ty ) ,
1358+ _ => bug ! ( "`float_to_int_unchecked` called with non-int output type {dest_ty :?}" ) ,
13671359 } )
13681360 }
13691361}
0 commit comments