@@ -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 ! [ ] ;
@@ -476,7 +476,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for RemapLateBound<'_, 'tcx> {
476476
477477fn emit_implied_wf_lint < ' tcx > (
478478 tcx : TyCtxt < ' tcx > ,
479- impl_m : & ty:: AssocItem ,
479+ impl_m : ty:: AssocItem ,
480480 hir_id : hir:: HirId ,
481481 bad_args : Vec < ( Span , Option < String > ) > ,
482482) {
@@ -523,8 +523,8 @@ enum CheckImpliedWfMode {
523523
524524fn compare_asyncness < ' tcx > (
525525 tcx : TyCtxt < ' tcx > ,
526- impl_m : & ty:: AssocItem ,
527- trait_m : & ty:: AssocItem ,
526+ impl_m : ty:: AssocItem ,
527+ trait_m : ty:: AssocItem ,
528528) -> Result < ( ) , ErrorGuaranteed > {
529529 if tcx. asyncness ( trait_m. def_id ) == hir:: IsAsync :: Async {
530530 match tcx. fn_sig ( impl_m. def_id ) . skip_binder ( ) . skip_binder ( ) . output ( ) . kind ( ) {
@@ -869,8 +869,8 @@ fn report_trait_method_mismatch<'tcx>(
869869 infcx : & InferCtxt < ' tcx > ,
870870 mut cause : ObligationCause < ' tcx > ,
871871 terr : TypeError < ' tcx > ,
872- ( trait_m, trait_sig) : ( & ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
873- ( impl_m, impl_sig) : ( & ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
872+ ( trait_m, trait_sig) : ( ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
873+ ( impl_m, impl_sig) : ( ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
874874 impl_trait_ref : ty:: TraitRef < ' tcx > ,
875875) -> ErrorGuaranteed {
876876 let tcx = infcx. tcx ;
@@ -963,8 +963,8 @@ fn report_trait_method_mismatch<'tcx>(
963963
964964fn check_region_bounds_on_impl_item < ' tcx > (
965965 tcx : TyCtxt < ' tcx > ,
966- impl_m : & ty:: AssocItem ,
967- trait_m : & ty:: AssocItem ,
966+ impl_m : ty:: AssocItem ,
967+ trait_m : ty:: AssocItem ,
968968 delay : bool ,
969969) -> Result < ( ) , ErrorGuaranteed > {
970970 let impl_generics = tcx. generics_of ( impl_m. def_id ) ;
@@ -1038,7 +1038,7 @@ fn check_region_bounds_on_impl_item<'tcx>(
10381038 . sess
10391039 . create_err ( LifetimesOrBoundsMismatchOnTrait {
10401040 span,
1041- item_kind : assoc_item_kind_str ( impl_m) ,
1041+ item_kind : assoc_item_kind_str ( & impl_m) ,
10421042 ident : impl_m. ident ( tcx) ,
10431043 generics_span,
10441044 bounds_span,
@@ -1056,8 +1056,8 @@ fn extract_spans_for_error_reporting<'tcx>(
10561056 infcx : & infer:: InferCtxt < ' tcx > ,
10571057 terr : TypeError < ' _ > ,
10581058 cause : & ObligationCause < ' tcx > ,
1059- impl_m : & ty:: AssocItem ,
1060- trait_m : & ty:: AssocItem ,
1059+ impl_m : ty:: AssocItem ,
1060+ trait_m : ty:: AssocItem ,
10611061) -> ( Span , Option < Span > ) {
10621062 let tcx = infcx. tcx ;
10631063 let mut impl_args = {
@@ -1080,8 +1080,8 @@ fn extract_spans_for_error_reporting<'tcx>(
10801080
10811081fn compare_self_type < ' tcx > (
10821082 tcx : TyCtxt < ' tcx > ,
1083- impl_m : & ty:: AssocItem ,
1084- trait_m : & ty:: AssocItem ,
1083+ impl_m : ty:: AssocItem ,
1084+ trait_m : ty:: AssocItem ,
10851085 impl_trait_ref : ty:: TraitRef < ' tcx > ,
10861086) -> Result < ( ) , ErrorGuaranteed > {
10871087 // Try to give more informative error messages about self typing
@@ -1092,7 +1092,7 @@ fn compare_self_type<'tcx>(
10921092 // inscrutable, particularly for cases where one method has no
10931093 // self.
10941094
1095- let self_string = |method : & ty:: AssocItem | {
1095+ let self_string = |method : ty:: AssocItem | {
10961096 let untransformed_self_ty = match method. container {
10971097 ty:: ImplContainer => impl_trait_ref. self_ty ( ) ,
10981098 ty:: TraitContainer => tcx. types . self_param ,
@@ -1182,8 +1182,8 @@ fn compare_self_type<'tcx>(
11821182/// [`compare_generic_param_kinds`]. This function also does not handle lifetime parameters
11831183fn compare_number_of_generics < ' tcx > (
11841184 tcx : TyCtxt < ' tcx > ,
1185- impl_ : & ty:: AssocItem ,
1186- trait_ : & ty:: AssocItem ,
1185+ impl_ : ty:: AssocItem ,
1186+ trait_ : ty:: AssocItem ,
11871187 delay : bool ,
11881188) -> Result < ( ) , ErrorGuaranteed > {
11891189 let trait_own_counts = tcx. generics_of ( trait_. def_id ) . own_counts ( ) ;
@@ -1203,7 +1203,7 @@ fn compare_number_of_generics<'tcx>(
12031203 ( "const" , trait_own_counts. consts , impl_own_counts. consts ) ,
12041204 ] ;
12051205
1206- let item_kind = assoc_item_kind_str ( impl_) ;
1206+ let item_kind = assoc_item_kind_str ( & impl_) ;
12071207
12081208 let mut err_occurred = None ;
12091209 for ( kind, trait_count, impl_count) in matchings {
@@ -1325,8 +1325,8 @@ fn compare_number_of_generics<'tcx>(
13251325
13261326fn compare_number_of_method_arguments < ' tcx > (
13271327 tcx : TyCtxt < ' tcx > ,
1328- impl_m : & ty:: AssocItem ,
1329- trait_m : & ty:: AssocItem ,
1328+ impl_m : ty:: AssocItem ,
1329+ trait_m : ty:: AssocItem ,
13301330) -> Result < ( ) , ErrorGuaranteed > {
13311331 let impl_m_fty = tcx. fn_sig ( impl_m. def_id ) ;
13321332 let trait_m_fty = tcx. fn_sig ( trait_m. def_id ) ;
@@ -1405,8 +1405,8 @@ fn compare_number_of_method_arguments<'tcx>(
14051405
14061406fn compare_synthetic_generics < ' tcx > (
14071407 tcx : TyCtxt < ' tcx > ,
1408- impl_m : & ty:: AssocItem ,
1409- trait_m : & ty:: AssocItem ,
1408+ impl_m : ty:: AssocItem ,
1409+ trait_m : ty:: AssocItem ,
14101410) -> Result < ( ) , ErrorGuaranteed > {
14111411 // FIXME(chrisvittal) Clean up this function, list of FIXME items:
14121412 // 1. Better messages for the span labels
@@ -1559,8 +1559,8 @@ fn compare_synthetic_generics<'tcx>(
15591559/// This function does not handle lifetime parameters
15601560fn compare_generic_param_kinds < ' tcx > (
15611561 tcx : TyCtxt < ' tcx > ,
1562- impl_item : & ty:: AssocItem ,
1563- trait_item : & ty:: AssocItem ,
1562+ impl_item : ty:: AssocItem ,
1563+ trait_item : ty:: AssocItem ,
15641564 delay : bool ,
15651565) -> Result < ( ) , ErrorGuaranteed > {
15661566 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