@@ -85,14 +85,14 @@ impl<'a, 'tcx, 'v> Visitor<'v> for BorrowckCtxt<'a, 'tcx> {
85
85
86
86
fn visit_trait_item ( & mut self , ti : & hir:: TraitItem ) {
87
87
if let hir:: ConstTraitItem ( _, Some ( ref expr) ) = ti. node {
88
- gather_loans:: gather_loans_in_static_initializer ( self , & * expr) ;
88
+ gather_loans:: gather_loans_in_static_initializer ( self , & expr) ;
89
89
}
90
90
intravisit:: walk_trait_item ( self , ti) ;
91
91
}
92
92
93
93
fn visit_impl_item ( & mut self , ii : & hir:: ImplItem ) {
94
94
if let hir:: ImplItemKind :: Const ( _, ref expr) = ii. node {
95
- gather_loans:: gather_loans_in_static_initializer ( self , & * expr) ;
95
+ gather_loans:: gather_loans_in_static_initializer ( self , & expr) ;
96
96
}
97
97
intravisit:: walk_impl_item ( self , ii) ;
98
98
}
@@ -139,7 +139,7 @@ fn borrowck_item(this: &mut BorrowckCtxt, item: &hir::Item) {
139
139
match item. node {
140
140
hir:: ItemStatic ( _, _, ref ex) |
141
141
hir:: ItemConst ( _, ref ex) => {
142
- gather_loans:: gather_loans_in_static_initializer ( this, & * * ex) ;
142
+ gather_loans:: gather_loans_in_static_initializer ( this, & ex) ;
143
143
}
144
144
_ => { }
145
145
}
@@ -251,9 +251,9 @@ pub fn build_borrowck_dataflow_data_for_fn<'a, 'tcx>(
251
251
252
252
let dataflow_data = build_borrowck_dataflow_data ( & mut bccx,
253
253
fn_parts. kind ,
254
- & * fn_parts. decl ,
254
+ & fn_parts. decl ,
255
255
cfg,
256
- & * fn_parts. body ,
256
+ & fn_parts. body ,
257
257
fn_parts. span ,
258
258
fn_parts. id ) ;
259
259
@@ -426,12 +426,12 @@ impl<'tcx> LoanPath<'tcx> {
426
426
( & LpExtend ( ref base, _, LpInterior ( opt_variant_id, id) ) ,
427
427
& LpExtend ( ref base2, _, LpInterior ( opt_variant_id2, id2) ) ) =>
428
428
if id == id2 && opt_variant_id == opt_variant_id2 {
429
- base. has_fork ( & * * base2)
429
+ base. has_fork ( & base2)
430
430
} else {
431
431
true
432
432
} ,
433
433
( & LpExtend ( ref base, _, LpDeref ( _) ) , _) => base. has_fork ( other) ,
434
- ( _, & LpExtend ( ref base, _, LpDeref ( _) ) ) => self . has_fork ( & * * base) ,
434
+ ( _, & LpExtend ( ref base, _, LpDeref ( _) ) ) => self . has_fork ( & base) ,
435
435
_ => false ,
436
436
}
437
437
}
@@ -449,7 +449,7 @@ impl<'tcx> LoanPath<'tcx> {
449
449
( & LpExtend ( ref base, a, LpInterior ( opt_variant_id, id) ) ,
450
450
& LpExtend ( ref base2, _, LpInterior ( opt_variant_id2, id2) ) ) => {
451
451
if id == id2 && opt_variant_id == opt_variant_id2 {
452
- base. common ( & * * base2) . map ( |x| {
452
+ base. common ( & base2) . map ( |x| {
453
453
let xd = x. depth ( ) ;
454
454
if base. depth ( ) == xd && base2. depth ( ) == xd {
455
455
assert_eq ! ( base. ty, base2. ty) ;
@@ -463,11 +463,11 @@ impl<'tcx> LoanPath<'tcx> {
463
463
}
464
464
} )
465
465
} else {
466
- base. common ( & * * base2)
466
+ base. common ( & base2)
467
467
}
468
468
}
469
469
( & LpExtend ( ref base, _, LpDeref ( _) ) , _) => base. common ( other) ,
470
- ( _, & LpExtend ( ref other, _, LpDeref ( _) ) ) => self . common ( & * * other) ,
470
+ ( _, & LpExtend ( ref other, _, LpDeref ( _) ) ) => self . common ( & other) ,
471
471
( & LpVar ( id) , & LpVar ( id2) ) => {
472
472
if id == id2 {
473
473
assert_eq ! ( self . ty, other. ty) ;
@@ -673,7 +673,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
673
673
. map
674
674
. find ( the_move. id ) {
675
675
Some ( hir_map:: NodeExpr ( expr) ) => {
676
- ( self . tcx . expr_ty_adjusted ( & * expr) , expr. span )
676
+ ( self . tcx . expr_ty_adjusted ( & expr) , expr. span )
677
677
}
678
678
r => {
679
679
self . tcx . sess . bug ( & format ! ( "MoveExpr({}) maps to \
@@ -735,7 +735,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
735
735
. map
736
736
. find ( the_move. id ) {
737
737
Some ( hir_map:: NodeExpr ( expr) ) => {
738
- ( self . tcx . expr_ty_adjusted ( & * expr) , expr. span )
738
+ ( self . tcx . expr_ty_adjusted ( & expr) , expr. span )
739
739
}
740
740
r => {
741
741
self . tcx . sess . bug ( & format ! ( "Captured({}) maps to \
@@ -833,19 +833,19 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
833
833
err_mutbl => {
834
834
let descr = match err. cmt . note {
835
835
mc:: NoteClosureEnv ( _) | mc:: NoteUpvarRef ( _) => {
836
- self . cmt_to_string ( & * err. cmt )
836
+ self . cmt_to_string ( & err. cmt )
837
837
}
838
838
_ => match opt_loan_path ( & err. cmt ) {
839
839
None => {
840
840
format ! ( "{} {}" ,
841
841
err. cmt. mutbl. to_user_str( ) ,
842
- self . cmt_to_string( & * err. cmt) )
842
+ self . cmt_to_string( & err. cmt) )
843
843
}
844
844
Some ( lp) => {
845
845
format ! ( "{} {} `{}`" ,
846
846
err. cmt. mutbl. to_user_str( ) ,
847
- self . cmt_to_string( & * err. cmt) ,
848
- self . loan_path_to_string( & * lp) )
847
+ self . cmt_to_string( & err. cmt) ,
848
+ self . loan_path_to_string( & lp) )
849
849
}
850
850
}
851
851
} ;
@@ -876,7 +876,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
876
876
let msg = match opt_loan_path ( & err. cmt ) {
877
877
None => "borrowed value" . to_string ( ) ,
878
878
Some ( lp) => {
879
- format ! ( "`{}`" , self . loan_path_to_string( & * lp) )
879
+ format ! ( "`{}`" , self . loan_path_to_string( & lp) )
880
880
}
881
881
} ;
882
882
format ! ( "{} does not live long enough" , msg)
@@ -1051,9 +1051,9 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
1051
1051
err_borrowed_pointer_too_short( loan_scope, ptr_scope) => {
1052
1052
let descr = match opt_loan_path ( & err. cmt ) {
1053
1053
Some ( lp) => {
1054
- format ! ( "`{}`" , self . loan_path_to_string( & * lp) )
1054
+ format ! ( "`{}`" , self . loan_path_to_string( & lp) )
1055
1055
}
1056
- None => self . cmt_to_string ( & * err. cmt ) ,
1056
+ None => self . cmt_to_string ( & err. cmt ) ,
1057
1057
} ;
1058
1058
self . tcx . note_and_explain_region (
1059
1059
db,
@@ -1081,15 +1081,15 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
1081
1081
1082
1082
LpDowncast ( ref lp_base, variant_def_id) => {
1083
1083
out. push ( '(' ) ;
1084
- self . append_loan_path_to_string ( & * * lp_base, out) ;
1084
+ self . append_loan_path_to_string ( & lp_base, out) ;
1085
1085
out. push_str ( DOWNCAST_PRINTED_OPERATOR ) ;
1086
1086
out. push_str ( & self . tcx . item_path_str ( variant_def_id) ) ;
1087
1087
out. push ( ')' ) ;
1088
1088
}
1089
1089
1090
1090
1091
1091
LpExtend ( ref lp_base, _, LpInterior ( _, InteriorField ( fname) ) ) => {
1092
- self . append_autoderefd_loan_path_to_string ( & * * lp_base, out) ;
1092
+ self . append_autoderefd_loan_path_to_string ( & lp_base, out) ;
1093
1093
match fname {
1094
1094
mc:: NamedField ( fname) => {
1095
1095
out. push ( '.' ) ;
@@ -1103,13 +1103,13 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
1103
1103
}
1104
1104
1105
1105
LpExtend ( ref lp_base, _, LpInterior ( _, InteriorElement ( ..) ) ) => {
1106
- self . append_autoderefd_loan_path_to_string ( & * * lp_base, out) ;
1106
+ self . append_autoderefd_loan_path_to_string ( & lp_base, out) ;
1107
1107
out. push_str ( "[..]" ) ;
1108
1108
}
1109
1109
1110
1110
LpExtend ( ref lp_base, _, LpDeref ( _) ) => {
1111
1111
out. push ( '*' ) ;
1112
- self . append_loan_path_to_string ( & * * lp_base, out) ;
1112
+ self . append_loan_path_to_string ( & lp_base, out) ;
1113
1113
}
1114
1114
}
1115
1115
}
@@ -1122,12 +1122,12 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
1122
1122
// For a path like `(*x).f` or `(*x)[3]`, autoderef
1123
1123
// rules would normally allow users to omit the `*x`.
1124
1124
// So just serialize such paths to `x.f` or x[3]` respectively.
1125
- self . append_autoderefd_loan_path_to_string ( & * * lp_base, out)
1125
+ self . append_autoderefd_loan_path_to_string ( & lp_base, out)
1126
1126
}
1127
1127
1128
1128
LpDowncast ( ref lp_base, variant_def_id) => {
1129
1129
out. push ( '(' ) ;
1130
- self . append_autoderefd_loan_path_to_string ( & * * lp_base, out) ;
1130
+ self . append_autoderefd_loan_path_to_string ( & lp_base, out) ;
1131
1131
out. push ( ':' ) ;
1132
1132
out. push_str ( & self . tcx . item_path_str ( variant_def_id) ) ;
1133
1133
out. push ( ')' ) ;
0 commit comments