@@ -221,7 +221,10 @@ impl AllocHistory {
221
221
impl < ' history , ' ecx , ' mir , ' tcx > DiagnosticCx < ' history , ' ecx , ' mir , ' tcx > {
222
222
pub fn start_grant ( & mut self , perm : Permission ) {
223
223
let Operation :: Retag ( op) = & mut self . operation else {
224
- unreachable ! ( "start_grant must only be called during a retag, this is: {:?}" , self . operation)
224
+ unreachable ! (
225
+ "start_grant must only be called during a retag, this is: {:?}" ,
226
+ self . operation
227
+ )
225
228
} ;
226
229
op. permission = Some ( perm) ;
227
230
@@ -286,7 +289,8 @@ impl<'history, 'ecx, 'mir, 'tcx> DiagnosticCx<'history, 'ecx, 'mir, 'tcx> {
286
289
tag : BorTag ,
287
290
protector_tag : Option < BorTag > ,
288
291
) -> Option < TagHistory > {
289
- let Some ( created) = self . history
292
+ let Some ( created) = self
293
+ . history
290
294
. creations
291
295
. iter ( )
292
296
. rev ( )
@@ -315,22 +319,27 @@ impl<'history, 'ecx, 'mir, 'tcx> DiagnosticCx<'history, 'ecx, 'mir, 'tcx> {
315
319
None
316
320
}
317
321
} )
318
- } ) . or_else ( || {
322
+ } )
323
+ . or_else ( || {
319
324
// If we didn't find a retag that created this tag, it might be the base tag of
320
325
// this allocation.
321
326
if self . history . base . 0 . tag ( ) == tag {
322
327
Some ( (
323
- format ! ( "{tag:?} was created here, as the base tag for {:?}" , self . history. id) ,
324
- self . history . base . 1 . data ( )
328
+ format ! (
329
+ "{tag:?} was created here, as the base tag for {:?}" ,
330
+ self . history. id
331
+ ) ,
332
+ self . history . base . 1 . data ( ) ,
325
333
) )
326
334
} else {
327
335
None
328
336
}
329
- } ) else {
330
- // But if we don't have a creation event, this is related to a wildcard, and there
331
- // is really nothing we can do to help.
332
- return None ;
333
- } ;
337
+ } )
338
+ else {
339
+ // But if we don't have a creation event, this is related to a wildcard, and there
340
+ // is really nothing we can do to help.
341
+ return None ;
342
+ } ;
334
343
335
344
let invalidated = self . history . invalidations . iter ( ) . rev ( ) . find_map ( |event| {
336
345
if event. tag == tag { Some ( event. generate_diagnostic ( ) ) } else { None }
0 commit comments