@@ -247,7 +247,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
247247 pub ( in crate :: borrow_check) fn report_move_out_while_borrowed (
248248 & mut self ,
249249 location : Location ,
250- ( place, span) : ( & Place < ' tcx > , Span ) ,
250+ ( place, span) : ( Place < ' tcx > , Span ) ,
251251 borrow : & BorrowData < ' tcx > ,
252252 ) {
253253 debug ! (
@@ -291,7 +291,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
291291 pub ( in crate :: borrow_check) fn report_use_while_mutably_borrowed (
292292 & mut self ,
293293 location : Location ,
294- ( place, _span) : ( & Place < ' tcx > , Span ) ,
294+ ( place, _span) : ( Place < ' tcx > , Span ) ,
295295 borrow : & BorrowData < ' tcx > ,
296296 ) -> DiagnosticBuilder < ' cx > {
297297 let borrow_spans = self . retrieve_borrow_spans ( borrow) ;
@@ -330,7 +330,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
330330 pub ( in crate :: borrow_check) fn report_conflicting_borrow (
331331 & mut self ,
332332 location : Location ,
333- ( place, span) : ( & Place < ' tcx > , Span ) ,
333+ ( place, span) : ( Place < ' tcx > , Span ) ,
334334 gen_borrow_kind : BorrowKind ,
335335 issued_borrow : & BorrowData < ' tcx > ,
336336 ) -> DiagnosticBuilder < ' cx > {
@@ -347,7 +347,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
347347 } ;
348348
349349 let ( desc_place, msg_place, msg_borrow, union_type_name) =
350- self . describe_place_for_conflicting_borrow ( place, & issued_borrow. borrowed_place ) ;
350+ self . describe_place_for_conflicting_borrow ( place, issued_borrow. borrowed_place ) ;
351351
352352 let explanation = self . explain_why_borrow_contains_point ( location, issued_borrow, None ) ;
353353 let second_borrow_desc = if explanation. is_explained ( ) { "second " } else { "" } ;
@@ -396,8 +396,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
396396 ) ;
397397 self . suggest_split_at_mut_if_applicable (
398398 & mut err,
399- & place,
400- & issued_borrow. borrowed_place ,
399+ place,
400+ issued_borrow. borrowed_place ,
401401 ) ;
402402 err
403403 }
@@ -410,7 +410,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
410410 ( BorrowKind :: Mut { .. } , BorrowKind :: Shallow )
411411 | ( BorrowKind :: Unique , BorrowKind :: Shallow ) => {
412412 if let Some ( immutable_section_description) =
413- self . classify_immutable_section ( & issued_borrow. assigned_place )
413+ self . classify_immutable_section ( issued_borrow. assigned_place )
414414 {
415415 let mut err = self . cannot_mutate_in_immutable_section (
416416 span,
@@ -546,8 +546,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
546546 fn suggest_split_at_mut_if_applicable (
547547 & self ,
548548 err : & mut DiagnosticBuilder < ' _ > ,
549- place : & Place < ' tcx > ,
550- borrowed_place : & Place < ' tcx > ,
549+ place : Place < ' tcx > ,
550+ borrowed_place : Place < ' tcx > ,
551551 ) {
552552 if let ( [ ProjectionElem :: Index ( _) ] , [ ProjectionElem :: Index ( _) ] ) =
553553 ( & place. projection [ ..] , & borrowed_place. projection [ ..] )
@@ -584,8 +584,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
584584 /// > mutable (via `a.u.s.b`) [E0502]
585585 pub ( in crate :: borrow_check) fn describe_place_for_conflicting_borrow (
586586 & self ,
587- first_borrowed_place : & Place < ' tcx > ,
588- second_borrowed_place : & Place < ' tcx > ,
587+ first_borrowed_place : Place < ' tcx > ,
588+ second_borrowed_place : Place < ' tcx > ,
589589 ) -> ( String , String , String , String ) {
590590 // Define a small closure that we can use to check if the type of a place
591591 // is a union.
@@ -615,13 +615,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
615615 cursor = proj_base;
616616
617617 match elem {
618- ProjectionElem :: Field ( field, _)
619- if union_ty ( * local, proj_base) . is_some ( ) =>
620- {
621- return Some ( (
622- PlaceRef { local : * local, projection : proj_base } ,
623- field,
624- ) ) ;
618+ ProjectionElem :: Field ( field, _) if union_ty ( local, proj_base) . is_some ( ) => {
619+ return Some ( ( PlaceRef { local, projection : proj_base } , field) ) ;
625620 }
626621 _ => { }
627622 }
@@ -631,7 +626,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
631626 . and_then ( |( target_base, target_field) | {
632627 // With the place of a union and a field access into it, we traverse the second
633628 // borrowed place and look for a access to a different field of the same union.
634- let Place { local, ref projection } = * second_borrowed_place;
629+ let Place { local, ref projection } = second_borrowed_place;
635630
636631 let mut cursor = & projection[ ..] ;
637632 while let [ proj_base @ .., elem] = cursor {
@@ -682,7 +677,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
682677 & mut self ,
683678 location : Location ,
684679 borrow : & BorrowData < ' tcx > ,
685- place_span : ( & Place < ' tcx > , Span ) ,
680+ place_span : ( Place < ' tcx > , Span ) ,
686681 kind : Option < WriteKind > ,
687682 ) {
688683 debug ! (
@@ -967,7 +962,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
967962 & mut self ,
968963 location : Location ,
969964 borrow : & BorrowData < ' tcx > ,
970- ( place, drop_span) : ( & Place < ' tcx > , Span ) ,
965+ ( place, drop_span) : ( Place < ' tcx > , Span ) ,
971966 kind : Option < WriteKind > ,
972967 dropped_ty : Ty < ' tcx > ,
973968 ) {
@@ -1379,15 +1374,15 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
13791374 pub ( in crate :: borrow_check) fn report_illegal_mutation_of_borrowed (
13801375 & mut self ,
13811376 location : Location ,
1382- ( place, span) : ( & Place < ' tcx > , Span ) ,
1377+ ( place, span) : ( Place < ' tcx > , Span ) ,
13831378 loan : & BorrowData < ' tcx > ,
13841379 ) {
13851380 let loan_spans = self . retrieve_borrow_spans ( loan) ;
13861381 let loan_span = loan_spans. args_or_use ( ) ;
13871382
13881383 let descr_place = self . describe_any_place ( place. as_ref ( ) ) ;
13891384 if loan. kind == BorrowKind :: Shallow {
1390- if let Some ( section) = self . classify_immutable_section ( & loan. assigned_place ) {
1385+ if let Some ( section) = self . classify_immutable_section ( loan. assigned_place ) {
13911386 let mut err = self . cannot_mutate_in_immutable_section (
13921387 span,
13931388 loan_span,
@@ -1432,9 +1427,9 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
14321427 pub ( in crate :: borrow_check) fn report_illegal_reassignment (
14331428 & mut self ,
14341429 _location : Location ,
1435- ( place, span) : ( & Place < ' tcx > , Span ) ,
1430+ ( place, span) : ( Place < ' tcx > , Span ) ,
14361431 assigned_span : Span ,
1437- err_place : & Place < ' tcx > ,
1432+ err_place : Place < ' tcx > ,
14381433 ) {
14391434 let ( from_arg, local_decl, local_name) = match err_place. as_local ( ) {
14401435 Some ( local) => (
@@ -1539,17 +1534,17 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
15391534 }
15401535
15411536 /// Describe the reason for the fake borrow that was assigned to `place`.
1542- fn classify_immutable_section ( & self , place : & Place < ' tcx > ) -> Option < & ' static str > {
1537+ fn classify_immutable_section ( & self , place : Place < ' tcx > ) -> Option < & ' static str > {
15431538 use rustc_middle:: mir:: visit:: Visitor ;
1544- struct FakeReadCauseFinder < ' a , ' tcx > {
1545- place : & ' a Place < ' tcx > ,
1539+ struct FakeReadCauseFinder < ' tcx > {
1540+ place : Place < ' tcx > ,
15461541 cause : Option < FakeReadCause > ,
15471542 }
1548- impl < ' tcx > Visitor < ' tcx > for FakeReadCauseFinder < ' _ , ' tcx > {
1543+ impl < ' tcx > Visitor < ' tcx > for FakeReadCauseFinder < ' tcx > {
15491544 fn visit_statement ( & mut self , statement : & Statement < ' tcx > , _: Location ) {
15501545 match statement {
1551- Statement { kind : StatementKind :: FakeRead ( cause, box ref place) , .. }
1552- if * place == * self . place =>
1546+ Statement { kind : StatementKind :: FakeRead ( cause, box place) , .. }
1547+ if * place == self . place =>
15531548 {
15541549 self . cause = Some ( * cause) ;
15551550 }
0 commit comments