@@ -139,14 +139,14 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
139139 let is_partial_move = move_site_vec. iter ( ) . any ( |move_site| {
140140 let move_out = self . move_data . moves [ ( * move_site) . moi ] ;
141141 let moved_place = & self . move_data . move_paths [ move_out. path ] . place ;
142- used_place != moved_place. as_place_ref ( )
143- && used_place. is_prefix_of ( moved_place. as_place_ref ( ) )
142+ used_place != moved_place. as_ref ( )
143+ && used_place. is_prefix_of ( moved_place. as_ref ( ) )
144144 } ) ;
145145 for move_site in & move_site_vec {
146146 let move_out = self . move_data . moves [ ( * move_site) . moi ] ;
147147 let moved_place = & self . move_data . move_paths [ move_out. path ] . place ;
148148
149- let move_spans = self . move_spans ( moved_place. as_place_ref ( ) , move_out. source ) ;
149+ let move_spans = self . move_spans ( moved_place. as_ref ( ) , move_out. source ) ;
150150 let move_span = move_spans. args_or_use ( ) ;
151151
152152 let move_msg = if move_spans. for_closure ( ) {
@@ -223,7 +223,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
223223
224224 let ty = place. ty ( self . body , self . infcx . tcx ) . ty ;
225225 let opt_name =
226- self . describe_place_with_options ( place. as_place_ref ( ) , IncludingDowncast ( true ) ) ;
226+ self . describe_place_with_options ( place. as_ref ( ) , IncludingDowncast ( true ) ) ;
227227 let note_msg = match opt_name {
228228 Some ( ref name) => format ! ( "`{}`" , name) ,
229229 None => "value" . to_owned ( ) ,
@@ -275,24 +275,24 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
275275 "report_move_out_while_borrowed: location={:?} place={:?} span={:?} borrow={:?}" ,
276276 location, place, span, borrow
277277 ) ;
278- let value_msg = match self . describe_place ( place. as_place_ref ( ) ) {
278+ let value_msg = match self . describe_place ( place. as_ref ( ) ) {
279279 Some ( name) => format ! ( "`{}`" , name) ,
280280 None => "value" . to_owned ( ) ,
281281 } ;
282- let borrow_msg = match self . describe_place ( borrow. borrowed_place . as_place_ref ( ) ) {
282+ let borrow_msg = match self . describe_place ( borrow. borrowed_place . as_ref ( ) ) {
283283 Some ( name) => format ! ( "`{}`" , name) ,
284284 None => "value" . to_owned ( ) ,
285285 } ;
286286
287287 let borrow_spans = self . retrieve_borrow_spans ( borrow) ;
288288 let borrow_span = borrow_spans. args_or_use ( ) ;
289289
290- let move_spans = self . move_spans ( place. as_place_ref ( ) , location) ;
290+ let move_spans = self . move_spans ( place. as_ref ( ) , location) ;
291291 let span = move_spans. args_or_use ( ) ;
292292
293293 let mut err = self . cannot_move_when_borrowed (
294294 span,
295- & self . describe_place ( place. as_place_ref ( ) ) . unwrap_or_else ( || "_" . to_owned ( ) ) ,
295+ & self . describe_place ( place. as_ref ( ) ) . unwrap_or_else ( || "_" . to_owned ( ) ) ,
296296 ) ;
297297 err. span_label ( borrow_span, format ! ( "borrow of {} occurs here" , borrow_msg) ) ;
298298 err. span_label ( span, format ! ( "move out of {} occurs here" , value_msg) ) ;
@@ -326,21 +326,21 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
326326
327327 // Conflicting borrows are reported separately, so only check for move
328328 // captures.
329- let use_spans = self . move_spans ( place. as_place_ref ( ) , location) ;
329+ let use_spans = self . move_spans ( place. as_ref ( ) , location) ;
330330 let span = use_spans. var_or_use ( ) ;
331331
332332 let mut err = self . cannot_use_when_mutably_borrowed (
333333 span,
334- & self . describe_place ( place. as_place_ref ( ) ) . unwrap_or_else ( || "_" . to_owned ( ) ) ,
334+ & self . describe_place ( place. as_ref ( ) ) . unwrap_or_else ( || "_" . to_owned ( ) ) ,
335335 borrow_span,
336- & self . describe_place ( borrow. borrowed_place . as_place_ref ( ) )
336+ & self . describe_place ( borrow. borrowed_place . as_ref ( ) )
337337 . unwrap_or_else ( || "_" . to_owned ( ) ) ,
338338 ) ;
339339
340340 borrow_spans. var_span_label ( & mut err, {
341341 let place = & borrow. borrowed_place ;
342342 let desc_place =
343- self . describe_place ( place. as_place_ref ( ) ) . unwrap_or_else ( || "_" . to_owned ( ) ) ;
343+ self . describe_place ( place. as_ref ( ) ) . unwrap_or_else ( || "_" . to_owned ( ) ) ;
344344
345345 format ! ( "borrow occurs due to use of `{}`{}" , desc_place, borrow_spans. describe( ) )
346346 } ) ;
@@ -517,7 +517,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
517517 ) ;
518518 } else {
519519 let borrow_place = & issued_borrow. borrowed_place ;
520- let borrow_place_desc = self . describe_place ( borrow_place. as_place_ref ( ) )
520+ let borrow_place_desc = self . describe_place ( borrow_place. as_ref ( ) )
521521 . unwrap_or_else ( || "_" . to_owned ( ) ) ;
522522 issued_spans. var_span_label (
523523 & mut err,
@@ -650,8 +650,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
650650
651651 return Some ( (
652652 describe_base_place,
653- describe_place ( first_borrowed_place. as_place_ref ( ) ) ,
654- describe_place ( second_borrowed_place. as_place_ref ( ) ) ,
653+ describe_place ( first_borrowed_place. as_ref ( ) ) ,
654+ describe_place ( second_borrowed_place. as_ref ( ) ) ,
655655 union_ty. to_string ( ) ,
656656 ) ) ;
657657 }
@@ -666,7 +666,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
666666 // If we didn't find a field access into a union, or both places match, then
667667 // only return the description of the first place.
668668 (
669- describe_place ( first_borrowed_place. as_place_ref ( ) ) ,
669+ describe_place ( first_borrowed_place. as_ref ( ) ) ,
670670 "" . to_string ( ) ,
671671 "" . to_string ( ) ,
672672 "" . to_string ( ) ,
@@ -697,7 +697,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
697697 ) ;
698698
699699 let drop_span = place_span. 1 ;
700- let root_place = self . prefixes ( borrow. borrowed_place . as_place_ref ( ) , PrefixSet :: All )
700+ let root_place = self . prefixes ( borrow. borrowed_place . as_ref ( ) , PrefixSet :: All )
701701 . last ( )
702702 . unwrap ( ) ;
703703
@@ -730,21 +730,21 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
730730 } , borrow_span) ) ;
731731
732732 if let StorageDeadOrDrop :: Destructor ( dropped_ty) =
733- self . classify_drop_access_kind ( borrow. borrowed_place . as_place_ref ( ) )
733+ self . classify_drop_access_kind ( borrow. borrowed_place . as_ref ( ) )
734734 {
735735 // If a borrow of path `B` conflicts with drop of `D` (and
736736 // we're not in the uninteresting case where `B` is a
737737 // prefix of `D`), then report this as a more interesting
738738 // destructor conflict.
739- if !borrow. borrowed_place . as_place_ref ( ) . is_prefix_of ( place_span. 0 . as_place_ref ( ) ) {
739+ if !borrow. borrowed_place . as_ref ( ) . is_prefix_of ( place_span. 0 . as_ref ( ) ) {
740740 self . report_borrow_conflicts_with_destructor (
741741 location, borrow, place_span, kind, dropped_ty,
742742 ) ;
743743 return ;
744744 }
745745 }
746746
747- let place_desc = self . describe_place ( borrow. borrowed_place . as_place_ref ( ) ) ;
747+ let place_desc = self . describe_place ( borrow. borrowed_place . as_ref ( ) ) ;
748748
749749 let kind_place = kind. filter ( |_| place_desc. is_some ( ) ) . map ( |k| ( k, place_span. 0 ) ) ;
750750 let explanation = self . explain_why_borrow_contains_point ( location, & borrow, kind_place) ;
@@ -951,12 +951,12 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
951951
952952 let mut err = self . cannot_borrow_across_destructor ( borrow_span) ;
953953
954- let what_was_dropped = match self . describe_place ( place. as_place_ref ( ) ) {
954+ let what_was_dropped = match self . describe_place ( place. as_ref ( ) ) {
955955 Some ( name) => format ! ( "`{}`" , name. as_str( ) ) ,
956956 None => String :: from ( "temporary value" ) ,
957957 } ;
958958
959- let label = match self . describe_place ( borrow. borrowed_place . as_place_ref ( ) ) {
959+ let label = match self . describe_place ( borrow. borrowed_place . as_ref ( ) ) {
960960 Some ( borrowed) => format ! (
961961 "here, drop of {D} needs exclusive access to `{B}`, \
962962 because the type `{T}` implements the `Drop` trait",
@@ -1127,7 +1127,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
11271127 format ! ( "`{}` is borrowed here" , place_desc) ,
11281128 )
11291129 } else {
1130- let root_place = self . prefixes ( borrow. borrowed_place . as_place_ref ( ) ,
1130+ let root_place = self . prefixes ( borrow. borrowed_place . as_ref ( ) ,
11311131 PrefixSet :: All )
11321132 . last ( )
11331133 . unwrap ( ) ;
@@ -1390,7 +1390,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
13901390 let mut err = self . cannot_mutate_in_match_guard (
13911391 span,
13921392 loan_span,
1393- & self . describe_place ( place. as_place_ref ( ) ) . unwrap_or_else ( || "_" . to_owned ( ) ) ,
1393+ & self . describe_place ( place. as_ref ( ) ) . unwrap_or_else ( || "_" . to_owned ( ) ) ,
13941394 "assign" ,
13951395 ) ;
13961396 loan_spans. var_span_label (
@@ -1406,7 +1406,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
14061406 let mut err = self . cannot_assign_to_borrowed (
14071407 span,
14081408 loan_span,
1409- & self . describe_place ( place. as_place_ref ( ) ) . unwrap_or_else ( || "_" . to_owned ( ) ) ,
1409+ & self . describe_place ( place. as_ref ( ) ) . unwrap_or_else ( || "_" . to_owned ( ) ) ,
14101410 ) ;
14111411
14121412 loan_spans. var_span_label (
@@ -1466,8 +1466,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
14661466 is_user_variable : None ,
14671467 ..
14681468 } )
1469- | None => ( self . describe_place ( place. as_place_ref ( ) ) , assigned_span) ,
1470- Some ( decl) => ( self . describe_place ( err_place. as_place_ref ( ) ) , decl. source_info . span ) ,
1469+ | None => ( self . describe_place ( place. as_ref ( ) ) , assigned_span) ,
1470+ Some ( decl) => ( self . describe_place ( err_place. as_ref ( ) ) , decl. source_info . span ) ,
14711471 } ;
14721472
14731473 let mut err = self . cannot_reassign_immutable (
0 commit comments