@@ -140,7 +140,7 @@ impl fmt::Display for InvalidProgramInfo<'_> {
140
140
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
141
141
use InvalidProgramInfo :: * ;
142
142
match self {
143
- TooGeneric => write ! ( f , "encountered overly generic constant" ) ,
143
+ TooGeneric => f . write_str ( "encountered overly generic constant" ) ,
144
144
AlreadyReported ( ErrorGuaranteed { .. } ) => {
145
145
write ! (
146
146
f,
@@ -288,15 +288,15 @@ impl fmt::Display for UndefinedBehaviorInfo {
288
288
use UndefinedBehaviorInfo :: * ;
289
289
match self {
290
290
Ub ( msg) => write ! ( f, "{msg}" ) ,
291
- Unreachable => write ! ( f , "entering unreachable code" ) ,
291
+ Unreachable => f . write_str ( "entering unreachable code" ) ,
292
292
BoundsCheckFailed { ref len, ref index } => {
293
293
write ! ( f, "indexing out of bounds: the len is {len} but the index is {index}" )
294
294
}
295
- DivisionByZero => write ! ( f , "dividing by zero" ) ,
296
- RemainderByZero => write ! ( f , "calculating the remainder with a divisor of zero" ) ,
297
- DivisionOverflow => write ! ( f , "overflow in signed division (dividing MIN by -1)" ) ,
298
- RemainderOverflow => write ! ( f , "overflow in signed remainder (dividing MIN by -1)" ) ,
299
- PointerArithOverflow => write ! ( f , "overflowing in-bounds pointer arithmetic" ) ,
295
+ DivisionByZero => f . write_str ( "dividing by zero" ) ,
296
+ RemainderByZero => f . write_str ( "calculating the remainder with a divisor of zero" ) ,
297
+ DivisionOverflow => f . write_str ( "overflow in signed division (dividing MIN by -1)" ) ,
298
+ RemainderOverflow => f . write_str ( "overflow in signed remainder (dividing MIN by -1)" ) ,
299
+ PointerArithOverflow => f . write_str ( "overflowing in-bounds pointer arithmetic" ) ,
300
300
InvalidMeta ( msg) => write ! ( f, "invalid metadata in wide pointer: {msg}" ) ,
301
301
UnterminatedCString ( p) => write ! (
302
302
f,
@@ -367,13 +367,13 @@ impl fmt::Display for UndefinedBehaviorInfo {
367
367
f,
368
368
"using uninitialized data, but this operation requires initialized memory"
369
369
) ,
370
- DeadLocal => write ! ( f , "accessing a dead local variable" ) ,
370
+ DeadLocal => f . write_str ( "accessing a dead local variable" ) ,
371
371
ScalarSizeMismatch ( self :: ScalarSizeMismatch { target_size, data_size } ) => write ! (
372
372
f,
373
373
"scalar size mismatch: expected {target_size} bytes but got {data_size} bytes instead" ,
374
374
) ,
375
375
UninhabitedEnumVariantWritten => {
376
- write ! ( f , "writing discriminant of an uninhabited enum" )
376
+ f . write_str ( "writing discriminant of an uninhabited enum" )
377
377
}
378
378
}
379
379
}
@@ -414,7 +414,7 @@ impl fmt::Display for UnsupportedOpInfo {
414
414
PartialPointerCopy ( ptr) => {
415
415
write ! ( f, "unable to copy parts of a pointer from memory at {ptr:?}" )
416
416
}
417
- ReadPointerAsBytes => write ! ( f , "unable to turn pointer into raw bytes" ) ,
417
+ ReadPointerAsBytes => f . write_str ( "unable to turn pointer into raw bytes" ) ,
418
418
ThreadLocalStatic ( did) => write ! ( f, "cannot access thread local static ({did:?})" ) ,
419
419
ReadExternStatic ( did) => write ! ( f, "cannot read from extern static ({did:?})" ) ,
420
420
}
@@ -441,16 +441,16 @@ impl fmt::Display for ResourceExhaustionInfo {
441
441
use ResourceExhaustionInfo :: * ;
442
442
match self {
443
443
StackFrameLimitReached => {
444
- write ! ( f , "reached the configured maximum number of stack frames" )
444
+ f . write_str ( "reached the configured maximum number of stack frames" )
445
445
}
446
446
StepLimitReached => {
447
- write ! ( f , "exceeded interpreter step limit (see `#[const_eval_limit]`)" )
447
+ f . write_str ( "exceeded interpreter step limit (see `#[const_eval_limit]`)" )
448
448
}
449
449
MemoryExhausted => {
450
- write ! ( f , "tried to allocate more memory than available to compiler" )
450
+ f . write_str ( "tried to allocate more memory than available to compiler" )
451
451
}
452
452
AddressSpaceFull => {
453
- write ! ( f , "there are no more free addresses in the address space" )
453
+ f . write_str ( "there are no more free addresses in the address space" )
454
454
}
455
455
}
456
456
}
0 commit comments