@@ -38,8 +38,8 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
38
38
"cannot use {} because it was mutably borrowed" ,
39
39
desc,
40
40
)
41
- . span_label_mv ( borrow_span, format ! ( "{borrow_desc} is borrowed here" ) )
42
- . span_label_mv ( span, format ! ( "use of borrowed {borrow_desc}" ) )
41
+ . with_span_label ( borrow_span, format ! ( "{borrow_desc} is borrowed here" ) )
42
+ . with_span_label ( span, format ! ( "use of borrowed {borrow_desc}" ) )
43
43
}
44
44
45
45
pub ( crate ) fn cannot_mutably_borrow_multiply (
@@ -243,8 +243,8 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
243
243
"cannot assign to {} because it is borrowed" ,
244
244
desc,
245
245
)
246
- . span_label_mv ( borrow_span, format ! ( "{desc} is borrowed here" ) )
247
- . span_label_mv ( span, format ! ( "{desc} is assigned to here but it was already borrowed" ) )
246
+ . with_span_label ( borrow_span, format ! ( "{desc} is borrowed here" ) )
247
+ . with_span_label ( span, format ! ( "{desc} is assigned to here but it was already borrowed" ) )
248
248
}
249
249
250
250
pub ( crate ) fn cannot_reassign_immutable (
@@ -297,7 +297,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
297
297
ty,
298
298
type_name,
299
299
)
300
- . span_label_mv ( move_from_span, "cannot move out of here" )
300
+ . with_span_label ( move_from_span, "cannot move out of here" )
301
301
}
302
302
303
303
pub ( crate ) fn cannot_move_out_of_interior_of_drop (
@@ -312,7 +312,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
312
312
"cannot move out of type `{}`, which implements the `Drop` trait" ,
313
313
container_ty,
314
314
)
315
- . span_label_mv ( move_from_span, "cannot move out of here" )
315
+ . with_span_label ( move_from_span, "cannot move out of here" )
316
316
}
317
317
318
318
pub ( crate ) fn cannot_act_on_moved_value (
@@ -368,8 +368,8 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
368
368
immutable_place,
369
369
immutable_section,
370
370
)
371
- . span_label_mv ( mutate_span, format ! ( "cannot {action}" ) )
372
- . span_label_mv ( immutable_span, format ! ( "value is immutable in {immutable_section}" ) )
371
+ . with_span_label ( mutate_span, format ! ( "cannot {action}" ) )
372
+ . with_span_label ( immutable_span, format ! ( "value is immutable in {immutable_section}" ) )
373
373
}
374
374
375
375
pub ( crate ) fn cannot_borrow_across_coroutine_yield (
@@ -384,7 +384,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
384
384
E0626 ,
385
385
"borrow may still be in use when {coroutine_kind:#} yields" ,
386
386
)
387
- . span_label_mv ( yield_span, "possible yield occurs here" )
387
+ . with_span_label ( yield_span, "possible yield occurs here" )
388
388
}
389
389
390
390
pub ( crate ) fn cannot_borrow_across_destructor (
@@ -423,7 +423,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
423
423
REFERENCE = reference_desc,
424
424
LOCAL = path_desc,
425
425
)
426
- . span_label_mv (
426
+ . with_span_label (
427
427
span,
428
428
format ! ( "{return_kind}s a {reference_desc} data owned by the current function" ) ,
429
429
)
@@ -444,8 +444,8 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
444
444
"{closure_kind} may outlive the current {scope}, but it borrows {borrowed_path}, \
445
445
which is owned by the current {scope}",
446
446
)
447
- . span_label_mv ( capture_span, format ! ( "{borrowed_path} is borrowed here" ) )
448
- . span_label_mv ( closure_span, format ! ( "may outlive borrowed value {borrowed_path}" ) )
447
+ . with_span_label ( capture_span, format ! ( "{borrowed_path} is borrowed here" ) )
448
+ . with_span_label ( closure_span, format ! ( "may outlive borrowed value {borrowed_path}" ) )
449
449
}
450
450
451
451
pub ( crate ) fn thread_local_value_does_not_live_long_enough (
0 commit comments