@@ -37,8 +37,8 @@ use std::iter;
3737/// - `impl_trait_ref`: the TraitRef corresponding to the trait implementation
3838pub ( super ) fn compare_impl_method < ' tcx > (
3939 tcx : TyCtxt < ' tcx > ,
40- impl_m : & ty:: AssocItem ,
41- trait_m : & ty:: AssocItem ,
40+ impl_m : ty:: AssocItem ,
41+ trait_m : ty:: AssocItem ,
4242 impl_trait_ref : ty:: TraitRef < ' tcx > ,
4343) {
4444 debug ! ( "compare_impl_method(impl_trait_ref={:?})" , impl_trait_ref) ;
@@ -129,8 +129,8 @@ pub(super) fn compare_impl_method<'tcx>(
129129#[ instrument( level = "debug" , skip( tcx, impl_trait_ref) ) ]
130130fn compare_method_predicate_entailment < ' tcx > (
131131 tcx : TyCtxt < ' tcx > ,
132- impl_m : & ty:: AssocItem ,
133- trait_m : & ty:: AssocItem ,
132+ impl_m : ty:: AssocItem ,
133+ trait_m : ty:: AssocItem ,
134134 impl_trait_ref : ty:: TraitRef < ' tcx > ,
135135 check_implied_wf : CheckImpliedWfMode ,
136136) -> Result < ( ) , ErrorGuaranteed > {
@@ -381,8 +381,8 @@ fn compare_method_predicate_entailment<'tcx>(
381381fn extract_bad_args_for_implies_lint < ' tcx > (
382382 tcx : TyCtxt < ' tcx > ,
383383 errors : & [ infer:: RegionResolutionError < ' tcx > ] ,
384- ( trait_m, trait_sig) : ( & ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
385- ( impl_m, impl_sig) : ( & ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
384+ ( trait_m, trait_sig) : ( ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
385+ ( impl_m, impl_sig) : ( ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
386386 hir_id : hir:: HirId ,
387387) -> Vec < ( Span , Option < String > ) > {
388388 let mut blame_generics = vec ! [ ] ;
@@ -480,7 +480,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for RemapLateBound<'_, 'tcx> {
480480
481481fn emit_implied_wf_lint < ' tcx > (
482482 tcx : TyCtxt < ' tcx > ,
483- impl_m : & ty:: AssocItem ,
483+ impl_m : ty:: AssocItem ,
484484 hir_id : hir:: HirId ,
485485 bad_args : Vec < ( Span , Option < String > ) > ,
486486) {
@@ -527,8 +527,8 @@ enum CheckImpliedWfMode {
527527
528528fn compare_asyncness < ' tcx > (
529529 tcx : TyCtxt < ' tcx > ,
530- impl_m : & ty:: AssocItem ,
531- trait_m : & ty:: AssocItem ,
530+ impl_m : ty:: AssocItem ,
531+ trait_m : ty:: AssocItem ,
532532) -> Result < ( ) , ErrorGuaranteed > {
533533 if tcx. asyncness ( trait_m. def_id ) == hir:: IsAsync :: Async {
534534 match tcx. fn_sig ( impl_m. def_id ) . skip_binder ( ) . skip_binder ( ) . output ( ) . kind ( ) {
@@ -873,8 +873,8 @@ fn report_trait_method_mismatch<'tcx>(
873873 infcx : & InferCtxt < ' tcx > ,
874874 mut cause : ObligationCause < ' tcx > ,
875875 terr : TypeError < ' tcx > ,
876- ( trait_m, trait_sig) : ( & ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
877- ( impl_m, impl_sig) : ( & ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
876+ ( trait_m, trait_sig) : ( ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
877+ ( impl_m, impl_sig) : ( ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
878878 impl_trait_ref : ty:: TraitRef < ' tcx > ,
879879) -> ErrorGuaranteed {
880880 let tcx = infcx. tcx ;
@@ -967,8 +967,8 @@ fn report_trait_method_mismatch<'tcx>(
967967
968968fn check_region_bounds_on_impl_item < ' tcx > (
969969 tcx : TyCtxt < ' tcx > ,
970- impl_m : & ty:: AssocItem ,
971- trait_m : & ty:: AssocItem ,
970+ impl_m : ty:: AssocItem ,
971+ trait_m : ty:: AssocItem ,
972972 delay : bool ,
973973) -> Result < ( ) , ErrorGuaranteed > {
974974 let impl_generics = tcx. generics_of ( impl_m. def_id ) ;
@@ -1042,7 +1042,7 @@ fn check_region_bounds_on_impl_item<'tcx>(
10421042 . sess
10431043 . create_err ( LifetimesOrBoundsMismatchOnTrait {
10441044 span,
1045- item_kind : assoc_item_kind_str ( impl_m) ,
1045+ item_kind : assoc_item_kind_str ( & impl_m) ,
10461046 ident : impl_m. ident ( tcx) ,
10471047 generics_span,
10481048 bounds_span,
@@ -1060,8 +1060,8 @@ fn extract_spans_for_error_reporting<'tcx>(
10601060 infcx : & infer:: InferCtxt < ' tcx > ,
10611061 terr : TypeError < ' _ > ,
10621062 cause : & ObligationCause < ' tcx > ,
1063- impl_m : & ty:: AssocItem ,
1064- trait_m : & ty:: AssocItem ,
1063+ impl_m : ty:: AssocItem ,
1064+ trait_m : ty:: AssocItem ,
10651065) -> ( Span , Option < Span > ) {
10661066 let tcx = infcx. tcx ;
10671067 let mut impl_args = {
@@ -1084,8 +1084,8 @@ fn extract_spans_for_error_reporting<'tcx>(
10841084
10851085fn compare_self_type < ' tcx > (
10861086 tcx : TyCtxt < ' tcx > ,
1087- impl_m : & ty:: AssocItem ,
1088- trait_m : & ty:: AssocItem ,
1087+ impl_m : ty:: AssocItem ,
1088+ trait_m : ty:: AssocItem ,
10891089 impl_trait_ref : ty:: TraitRef < ' tcx > ,
10901090) -> Result < ( ) , ErrorGuaranteed > {
10911091 // Try to give more informative error messages about self typing
@@ -1096,7 +1096,7 @@ fn compare_self_type<'tcx>(
10961096 // inscrutable, particularly for cases where one method has no
10971097 // self.
10981098
1099- let self_string = |method : & ty:: AssocItem | {
1099+ let self_string = |method : ty:: AssocItem | {
11001100 let untransformed_self_ty = match method. container {
11011101 ty:: ImplContainer => impl_trait_ref. self_ty ( ) ,
11021102 ty:: TraitContainer => tcx. types . self_param ,
@@ -1186,8 +1186,8 @@ fn compare_self_type<'tcx>(
11861186/// [`compare_generic_param_kinds`]. This function also does not handle lifetime parameters
11871187fn compare_number_of_generics < ' tcx > (
11881188 tcx : TyCtxt < ' tcx > ,
1189- impl_ : & ty:: AssocItem ,
1190- trait_ : & ty:: AssocItem ,
1189+ impl_ : ty:: AssocItem ,
1190+ trait_ : ty:: AssocItem ,
11911191 delay : bool ,
11921192) -> Result < ( ) , ErrorGuaranteed > {
11931193 let trait_own_counts = tcx. generics_of ( trait_. def_id ) . own_counts ( ) ;
@@ -1207,7 +1207,7 @@ fn compare_number_of_generics<'tcx>(
12071207 ( "const" , trait_own_counts. consts , impl_own_counts. consts ) ,
12081208 ] ;
12091209
1210- let item_kind = assoc_item_kind_str ( impl_) ;
1210+ let item_kind = assoc_item_kind_str ( & impl_) ;
12111211
12121212 let mut err_occurred = None ;
12131213 for ( kind, trait_count, impl_count) in matchings {
@@ -1329,8 +1329,8 @@ fn compare_number_of_generics<'tcx>(
13291329
13301330fn compare_number_of_method_arguments < ' tcx > (
13311331 tcx : TyCtxt < ' tcx > ,
1332- impl_m : & ty:: AssocItem ,
1333- trait_m : & ty:: AssocItem ,
1332+ impl_m : ty:: AssocItem ,
1333+ trait_m : ty:: AssocItem ,
13341334) -> Result < ( ) , ErrorGuaranteed > {
13351335 let impl_m_fty = tcx. fn_sig ( impl_m. def_id ) ;
13361336 let trait_m_fty = tcx. fn_sig ( trait_m. def_id ) ;
@@ -1409,8 +1409,8 @@ fn compare_number_of_method_arguments<'tcx>(
14091409
14101410fn compare_synthetic_generics < ' tcx > (
14111411 tcx : TyCtxt < ' tcx > ,
1412- impl_m : & ty:: AssocItem ,
1413- trait_m : & ty:: AssocItem ,
1412+ impl_m : ty:: AssocItem ,
1413+ trait_m : ty:: AssocItem ,
14141414) -> Result < ( ) , ErrorGuaranteed > {
14151415 // FIXME(chrisvittal) Clean up this function, list of FIXME items:
14161416 // 1. Better messages for the span labels
@@ -1563,8 +1563,8 @@ fn compare_synthetic_generics<'tcx>(
15631563/// This function does not handle lifetime parameters
15641564fn compare_generic_param_kinds < ' tcx > (
15651565 tcx : TyCtxt < ' tcx > ,
1566- impl_item : & ty:: AssocItem ,
1567- trait_item : & ty:: AssocItem ,
1566+ impl_item : ty:: AssocItem ,
1567+ trait_item : ty:: AssocItem ,
15681568 delay : bool ,
15691569) -> Result < ( ) , ErrorGuaranteed > {
15701570 assert_eq ! ( impl_item. kind, trait_item. kind) ;
@@ -1736,8 +1736,8 @@ pub(super) fn compare_impl_const_raw(
17361736
17371737pub ( super ) fn compare_impl_ty < ' tcx > (
17381738 tcx : TyCtxt < ' tcx > ,
1739- impl_ty : & ty:: AssocItem ,
1740- trait_ty : & ty:: AssocItem ,
1739+ impl_ty : ty:: AssocItem ,
1740+ trait_ty : ty:: AssocItem ,
17411741 impl_trait_ref : ty:: TraitRef < ' tcx > ,
17421742) {
17431743 debug ! ( "compare_impl_type(impl_trait_ref={:?})" , impl_trait_ref) ;
@@ -1754,8 +1754,8 @@ pub(super) fn compare_impl_ty<'tcx>(
17541754/// instead of associated functions.
17551755fn compare_type_predicate_entailment < ' tcx > (
17561756 tcx : TyCtxt < ' tcx > ,
1757- impl_ty : & ty:: AssocItem ,
1758- trait_ty : & ty:: AssocItem ,
1757+ impl_ty : ty:: AssocItem ,
1758+ trait_ty : ty:: AssocItem ,
17591759 impl_trait_ref : ty:: TraitRef < ' tcx > ,
17601760) -> Result < ( ) , ErrorGuaranteed > {
17611761 let impl_substs = InternalSubsts :: identity_for_item ( tcx, impl_ty. def_id ) ;
@@ -1855,8 +1855,8 @@ fn compare_type_predicate_entailment<'tcx>(
18551855#[ instrument( level = "debug" , skip( tcx) ) ]
18561856pub ( super ) fn check_type_bounds < ' tcx > (
18571857 tcx : TyCtxt < ' tcx > ,
1858- trait_ty : & ty:: AssocItem ,
1859- impl_ty : & ty:: AssocItem ,
1858+ trait_ty : ty:: AssocItem ,
1859+ impl_ty : ty:: AssocItem ,
18601860 impl_trait_ref : ty:: TraitRef < ' tcx > ,
18611861) -> Result < ( ) , ErrorGuaranteed > {
18621862 // Given
0 commit comments