@@ -79,7 +79,7 @@ impl<'a, 'tcx> MismatchRelation<'a, 'tcx> {
7979 let old_ty = self . tcx . type_of ( old_def_id) ;
8080 let new_ty = self . tcx . type_of ( new_def_id) ;
8181 debug ! ( "relating item pair" ) ;
82- let _ = self . relate ( & old_ty, & new_ty) ;
82+ let _ = self . relate ( old_ty, new_ty) ;
8383 }
8484 }
8585
@@ -118,13 +118,13 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> {
118118 fn relate_with_variance < T : Relate < ' tcx > > (
119119 & mut self ,
120120 _: ty:: Variance ,
121- a : & T ,
122- b : & T ,
121+ a : T ,
122+ b : T ,
123123 ) -> RelateResult < ' tcx , T > {
124124 self . relate ( a, b)
125125 }
126126
127- fn relate < T : Relate < ' tcx > > ( & mut self , a : & T , b : & T ) -> RelateResult < ' tcx , T > {
127+ fn relate < T : Relate < ' tcx > > ( & mut self , a : T , b : T ) -> RelateResult < ' tcx , T > {
128128 debug ! ( "relate: mismatch relation: a: {:?}, b: {:?}" , a, b) ;
129129 Relate :: relate ( self , a, b)
130130 }
@@ -135,7 +135,7 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> {
135135 use rustc_middle:: ty:: TyKind ;
136136
137137 if self . current_old_types . contains ( a) || self . current_new_types . contains ( b) {
138- return Ok ( self . tcx . types . err ) ;
138+ return Ok ( self . tcx . ty_error ( ) ) ;
139139 }
140140
141141 self . current_old_types . insert ( a) ;
@@ -161,7 +161,7 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> {
161161 {
162162 let b_field_ty = b_field. ty ( self . tcx , b_substs) ;
163163
164- let _ = self . relate ( & a_field_ty, & b_field_ty) ?;
164+ let _ = self . relate ( a_field_ty, b_field_ty) ?;
165165 }
166166 }
167167
@@ -188,16 +188,16 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> {
188188 }
189189 ( & TyKind :: Array ( a_t, _) , & TyKind :: Array ( b_t, _) )
190190 | ( & TyKind :: Slice ( a_t) , & TyKind :: Slice ( b_t) ) => {
191- let _ = self . relate ( & a_t, & b_t) ?;
191+ let _ = self . relate ( a_t, b_t) ?;
192192 None
193193 }
194194 ( & TyKind :: RawPtr ( a_mt) , & TyKind :: RawPtr ( b_mt) ) => {
195- let _ = self . relate ( & a_mt, & b_mt) ?;
195+ let _ = self . relate ( a_mt, b_mt) ?;
196196 None
197197 }
198198 ( & TyKind :: Ref ( a_r, a_ty, _) , & TyKind :: Ref ( b_r, b_ty, _) ) => {
199- let _ = self . relate ( & a_r, & b_r) ?;
200- let _ = self . relate ( & a_ty, & b_ty) ?;
199+ let _ = self . relate ( a_r, b_r) ?;
200+ let _ = self . relate ( a_ty, b_ty) ?;
201201 None
202202 }
203203 ( & TyKind :: FnDef ( a_def_id, a_substs) , & TyKind :: FnDef ( b_def_id, b_substs) ) => {
@@ -214,17 +214,17 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> {
214214 Some ( ( a, b) )
215215 }
216216 ( & TyKind :: FnPtr ( a_fty) , & TyKind :: FnPtr ( b_fty) ) => {
217- let _ = self . relate ( & a_fty, & b_fty) ?;
217+ let _ = self . relate ( a_fty, b_fty) ?;
218218 None
219219 }
220220 ( & TyKind :: Dynamic ( a_obj, a_r) , & TyKind :: Dynamic ( b_obj, b_r) ) => {
221- let _ = self . relate ( & a_r, & b_r) ?;
221+ let _ = self . relate ( a_r, b_r) ?;
222222 let a = a_obj. principal ( ) ;
223223 let b = b_obj. principal ( ) ;
224224
225225 if let ( Some ( a) , Some ( b) ) = ( a, b) {
226226 if self . check_substs ( a. skip_binder ( ) . substs , b. skip_binder ( ) . substs ) {
227- let _ = self . relate ( & a. skip_binder ( ) . substs , & b. skip_binder ( ) . substs ) ?;
227+ let _ = self . relate ( a. skip_binder ( ) . substs , b. skip_binder ( ) . substs ) ?;
228228 let a = Res :: Def ( DefKind :: Trait , a. skip_binder ( ) . def_id ) ;
229229 let b = Res :: Def ( DefKind :: Trait , b. skip_binder ( ) . def_id ) ;
230230 Some ( ( a, b) )
@@ -236,11 +236,11 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> {
236236 }
237237 }
238238 ( & TyKind :: Tuple ( as_) , & TyKind :: Tuple ( bs) ) => {
239- let _ = as_. iter ( ) . zip ( bs) . map ( |( a, b) | self . relate ( & a, & b) ) ;
239+ let _ = as_. iter ( ) . zip ( bs) . map ( |( a, b) | self . relate ( a, b) ) ;
240240 None
241241 }
242242 ( & TyKind :: Projection ( a_data) , & TyKind :: Projection ( b_data) ) => {
243- let _ = self . relate ( & a_data, & b_data) ?;
243+ let _ = self . relate ( a_data, b_data) ?;
244244
245245 let a = Res :: Def ( DefKind :: AssocTy , a_data. item_def_id ) ;
246246 let b = Res :: Def ( DefKind :: AssocTy , b_data. item_def_id ) ;
@@ -279,7 +279,7 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> {
279279 }
280280 }
281281
282- Ok ( self . tcx . types . err )
282+ Ok ( self . tcx . ty_error ( ) )
283283 }
284284
285285 fn regions (
@@ -300,8 +300,8 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> {
300300
301301 fn binders < T : Relate < ' tcx > > (
302302 & mut self ,
303- a : & ty:: Binder < T > ,
304- b : & ty:: Binder < T > ,
303+ a : ty:: Binder < T > ,
304+ b : ty:: Binder < T > ,
305305 ) -> RelateResult < ' tcx , ty:: Binder < T > > {
306306 Ok ( ty:: Binder :: bind (
307307 self . relate ( a. skip_binder ( ) , b. skip_binder ( ) ) ?,
0 commit comments