@@ -302,8 +302,7 @@ pub(crate) enum LoanPathElem<'tcx> {
302
302
LpInterior ( Option < DefId > , InteriorKind ) ,
303
303
}
304
304
305
- pub ( crate ) fn closure_to_block ( closure_id : ast:: NodeId ,
306
- tcx : TyCtxt ) -> ast:: NodeId {
305
+ pub ( crate ) fn closure_to_block ( closure_id : ast:: NodeId , tcx : TyCtxt ) -> ast:: NodeId {
307
306
match tcx. hir . get ( closure_id) {
308
307
hir_map:: NodeExpr ( expr) => match expr. node {
309
308
hir:: ExprClosure ( .., body_id, _) => {
@@ -481,9 +480,9 @@ pub(crate) enum MovedValueUseKind {
481
480
482
481
impl < ' a , ' tcx > BorrowckCtxt < ' a , ' tcx > {
483
482
pub ( crate ) fn is_subregion_of ( & self ,
484
- r_sub : ty:: Region < ' tcx > ,
485
- r_sup : ty:: Region < ' tcx > )
486
- -> bool
483
+ r_sub : ty:: Region < ' tcx > ,
484
+ r_sup : ty:: Region < ' tcx > )
485
+ -> bool
487
486
{
488
487
let region_rels = RegionRelations :: new ( self . tcx ,
489
488
self . owner_def_id ,
@@ -512,12 +511,12 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
512
511
}
513
512
514
513
pub ( crate ) fn report_use_of_moved_value ( & self ,
515
- use_span : Span ,
516
- use_kind : MovedValueUseKind ,
517
- lp : & LoanPath < ' tcx > ,
518
- the_move : & move_data:: Move ,
519
- moved_lp : & LoanPath < ' tcx > ,
520
- _param_env : ty:: ParamEnv < ' tcx > ) {
514
+ use_span : Span ,
515
+ use_kind : MovedValueUseKind ,
516
+ lp : & LoanPath < ' tcx > ,
517
+ the_move : & move_data:: Move ,
518
+ moved_lp : & LoanPath < ' tcx > ,
519
+ _param_env : ty:: ParamEnv < ' tcx > ) {
521
520
let ( verb, verb_participle) = match use_kind {
522
521
MovedInUse => ( "use" , "used" ) ,
523
522
MovedInCapture => ( "capture" , "captured" ) ,
@@ -656,10 +655,10 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
656
655
}
657
656
658
657
pub ( crate ) fn report_reassigned_immutable_variable ( & self ,
659
- span : Span ,
660
- lp : & LoanPath < ' tcx > ,
661
- assign :
662
- & move_data:: Assignment ) {
658
+ span : Span ,
659
+ lp : & LoanPath < ' tcx > ,
660
+ assign :
661
+ & move_data:: Assignment ) {
663
662
let mut err = struct_span_err ! (
664
663
self . tcx. sess, span, E0384 ,
665
664
"re-assignment of immutable variable `{}`" ,
@@ -673,10 +672,10 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
673
672
}
674
673
675
674
pub ( crate ) fn struct_span_err_with_code < S : Into < MultiSpan > > ( & self ,
676
- s : S ,
677
- msg : & str ,
678
- code : & str )
679
- -> DiagnosticBuilder < ' a > {
675
+ s : S ,
676
+ msg : & str ,
677
+ code : & str )
678
+ -> DiagnosticBuilder < ' a > {
680
679
self . tcx . sess . struct_span_err_with_code ( s, msg, code)
681
680
}
682
681
@@ -749,10 +748,10 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
749
748
}
750
749
751
750
pub ( crate ) fn report_aliasability_violation ( & self ,
752
- span : Span ,
753
- kind : AliasableViolationKind ,
754
- cause : mc:: AliasableReason ,
755
- cmt : mc:: cmt < ' tcx > ) {
751
+ span : Span ,
752
+ kind : AliasableViolationKind ,
753
+ cause : mc:: AliasableReason ,
754
+ cmt : mc:: cmt < ' tcx > ) {
756
755
let mut is_closure = false ;
757
756
let prefix = match kind {
758
757
MutabilityViolation => {
@@ -1169,8 +1168,8 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
1169
1168
}
1170
1169
}
1171
1170
pub ( crate ) fn append_loan_path_to_string ( & self ,
1172
- loan_path : & LoanPath < ' tcx > ,
1173
- out : & mut String ) {
1171
+ loan_path : & LoanPath < ' tcx > ,
1172
+ out : & mut String ) {
1174
1173
match loan_path. kind {
1175
1174
LpUpvar ( ty:: UpvarId { var_id : id, closure_expr_id : _ } ) |
1176
1175
LpVar ( id) => {
@@ -1212,8 +1211,8 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
1212
1211
}
1213
1212
1214
1213
pub ( crate ) fn append_autoderefd_loan_path_to_string ( & self ,
1215
- loan_path : & LoanPath < ' tcx > ,
1216
- out : & mut String ) {
1214
+ loan_path : & LoanPath < ' tcx > ,
1215
+ out : & mut String ) {
1217
1216
match loan_path. kind {
1218
1217
LpExtend ( ref lp_base, _, LpDeref ( _) ) => {
1219
1218
// For a path like `(*x).f` or `(*x)[3]`, autoderef
0 commit comments