@@ -256,8 +256,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
256
256
"report_move_out_while_borrowed: location={:?} place={:?} span={:?} borrow={:?}" ,
257
257
location, place, span, borrow
258
258
) ;
259
- let value_msg = self . describe_place_str ( place. as_ref ( ) ) ;
260
- let borrow_msg = self . describe_place_str ( borrow. borrowed_place . as_ref ( ) ) ;
259
+ let value_msg = self . describe_any_place ( place. as_ref ( ) ) ;
260
+ let borrow_msg = self . describe_any_place ( borrow. borrowed_place . as_ref ( ) ) ;
261
261
262
262
let borrow_spans = self . retrieve_borrow_spans ( borrow) ;
263
263
let borrow_span = borrow_spans. args_or_use ( ) ;
@@ -266,7 +266,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
266
266
let span = move_spans. args_or_use ( ) ;
267
267
268
268
let mut err =
269
- self . cannot_move_when_borrowed ( span, & self . describe_place_str ( place. as_ref ( ) ) ) ;
269
+ self . cannot_move_when_borrowed ( span, & self . describe_any_place ( place. as_ref ( ) ) ) ;
270
270
err. span_label ( borrow_span, format ! ( "borrow of {} occurs here" , borrow_msg) ) ;
271
271
err. span_label ( span, format ! ( "move out of {} occurs here" , value_msg) ) ;
272
272
@@ -306,14 +306,14 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
306
306
307
307
let mut err = self . cannot_use_when_mutably_borrowed (
308
308
span,
309
- & self . describe_place_str ( place. as_ref ( ) ) ,
309
+ & self . describe_any_place ( place. as_ref ( ) ) ,
310
310
borrow_span,
311
- & self . describe_place_str ( borrow. borrowed_place . as_ref ( ) ) ,
311
+ & self . describe_any_place ( borrow. borrowed_place . as_ref ( ) ) ,
312
312
) ;
313
313
314
314
borrow_spans. var_span_label ( & mut err, {
315
315
let place = & borrow. borrowed_place ;
316
- let desc_place = self . describe_place_str ( place. as_ref ( ) ) ;
316
+ let desc_place = self . describe_any_place ( place. as_ref ( ) ) ;
317
317
format ! ( "borrow occurs due to use of {}{}" , desc_place, borrow_spans. describe( ) )
318
318
} ) ;
319
319
@@ -506,7 +506,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
506
506
) ;
507
507
} else {
508
508
let borrow_place = & issued_borrow. borrowed_place ;
509
- let borrow_place_desc = self . describe_place_str ( borrow_place. as_ref ( ) ) ;
509
+ let borrow_place_desc = self . describe_any_place ( borrow_place. as_ref ( ) ) ;
510
510
issued_spans. var_span_label (
511
511
& mut err,
512
512
format ! (
@@ -647,12 +647,12 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
647
647
&& proj_base == target_base. projection
648
648
{
649
649
return Some ( (
650
- self . describe_place_str ( PlaceRef {
650
+ self . describe_any_place ( PlaceRef {
651
651
local,
652
652
projection : proj_base,
653
653
} ) ,
654
- self . describe_place_str ( first_borrowed_place. as_ref ( ) ) ,
655
- self . describe_place_str ( second_borrowed_place. as_ref ( ) ) ,
654
+ self . describe_any_place ( first_borrowed_place. as_ref ( ) ) ,
655
+ self . describe_any_place ( second_borrowed_place. as_ref ( ) ) ,
656
656
union_ty. to_string ( ) ,
657
657
) ) ;
658
658
}
@@ -665,7 +665,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
665
665
// If we didn't find a field access into a union, or both places match, then
666
666
// only return the description of the first place.
667
667
(
668
- self . describe_place_str ( first_borrowed_place. as_ref ( ) ) ,
668
+ self . describe_any_place ( first_borrowed_place. as_ref ( ) ) ,
669
669
"" . to_string ( ) ,
670
670
"" . to_string ( ) ,
671
671
"" . to_string ( ) ,
@@ -1388,7 +1388,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1388
1388
let loan_spans = self . retrieve_borrow_spans ( loan) ;
1389
1389
let loan_span = loan_spans. args_or_use ( ) ;
1390
1390
1391
- let descr_place = self . describe_place_str ( place. as_ref ( ) ) ;
1391
+ let descr_place = self . describe_any_place ( place. as_ref ( ) ) ;
1392
1392
if loan. kind == BorrowKind :: Shallow {
1393
1393
if let Some ( section) = self . classify_immutable_section ( & loan. assigned_place ) {
1394
1394
let mut err = self . cannot_mutate_in_immutable_section (
@@ -1463,8 +1463,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1463
1463
} )
1464
1464
| Some ( LocalDecl { local_info : LocalInfo :: StaticRef { .. } , .. } )
1465
1465
| Some ( LocalDecl { local_info : LocalInfo :: Other , .. } )
1466
- | None => ( self . describe_place_str ( place. as_ref ( ) ) , assigned_span) ,
1467
- Some ( decl) => ( self . describe_place_str ( err_place. as_ref ( ) ) , decl. source_info . span ) ,
1466
+ | None => ( self . describe_any_place ( place. as_ref ( ) ) , assigned_span) ,
1467
+ Some ( decl) => ( self . describe_any_place ( err_place. as_ref ( ) ) , decl. source_info . span ) ,
1468
1468
} ;
1469
1469
1470
1470
let mut err = self . cannot_reassign_immutable ( span, & place_description, from_arg) ;
0 commit comments