@@ -37,8 +37,8 @@ use std::iter;
37
37
/// - `impl_trait_ref`: the TraitRef corresponding to the trait implementation
38
38
pub ( super ) fn compare_impl_method < ' tcx > (
39
39
tcx : TyCtxt < ' tcx > ,
40
- impl_m : & ty:: AssocItem ,
41
- trait_m : & ty:: AssocItem ,
40
+ impl_m : ty:: AssocItem ,
41
+ trait_m : ty:: AssocItem ,
42
42
impl_trait_ref : ty:: TraitRef < ' tcx > ,
43
43
) {
44
44
debug ! ( "compare_impl_method(impl_trait_ref={:?})" , impl_trait_ref) ;
@@ -129,8 +129,8 @@ pub(super) fn compare_impl_method<'tcx>(
129
129
#[ instrument( level = "debug" , skip( tcx, impl_trait_ref) ) ]
130
130
fn compare_method_predicate_entailment < ' tcx > (
131
131
tcx : TyCtxt < ' tcx > ,
132
- impl_m : & ty:: AssocItem ,
133
- trait_m : & ty:: AssocItem ,
132
+ impl_m : ty:: AssocItem ,
133
+ trait_m : ty:: AssocItem ,
134
134
impl_trait_ref : ty:: TraitRef < ' tcx > ,
135
135
check_implied_wf : CheckImpliedWfMode ,
136
136
) -> Result < ( ) , ErrorGuaranteed > {
@@ -381,8 +381,8 @@ fn compare_method_predicate_entailment<'tcx>(
381
381
fn extract_bad_args_for_implies_lint < ' tcx > (
382
382
tcx : TyCtxt < ' tcx > ,
383
383
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 > ) ,
386
386
hir_id : hir:: HirId ,
387
387
) -> Vec < ( Span , Option < String > ) > {
388
388
let mut blame_generics = vec ! [ ] ;
@@ -476,7 +476,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for RemapLateBound<'_, 'tcx> {
476
476
477
477
fn emit_implied_wf_lint < ' tcx > (
478
478
tcx : TyCtxt < ' tcx > ,
479
- impl_m : & ty:: AssocItem ,
479
+ impl_m : ty:: AssocItem ,
480
480
hir_id : hir:: HirId ,
481
481
bad_args : Vec < ( Span , Option < String > ) > ,
482
482
) {
@@ -523,8 +523,8 @@ enum CheckImpliedWfMode {
523
523
524
524
fn compare_asyncness < ' tcx > (
525
525
tcx : TyCtxt < ' tcx > ,
526
- impl_m : & ty:: AssocItem ,
527
- trait_m : & ty:: AssocItem ,
526
+ impl_m : ty:: AssocItem ,
527
+ trait_m : ty:: AssocItem ,
528
528
) -> Result < ( ) , ErrorGuaranteed > {
529
529
if tcx. asyncness ( trait_m. def_id ) == hir:: IsAsync :: Async {
530
530
match tcx. fn_sig ( impl_m. def_id ) . skip_binder ( ) . skip_binder ( ) . output ( ) . kind ( ) {
@@ -869,8 +869,8 @@ fn report_trait_method_mismatch<'tcx>(
869
869
infcx : & InferCtxt < ' tcx > ,
870
870
mut cause : ObligationCause < ' tcx > ,
871
871
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 > ) ,
874
874
impl_trait_ref : ty:: TraitRef < ' tcx > ,
875
875
) -> ErrorGuaranteed {
876
876
let tcx = infcx. tcx ;
@@ -963,8 +963,8 @@ fn report_trait_method_mismatch<'tcx>(
963
963
964
964
fn check_region_bounds_on_impl_item < ' tcx > (
965
965
tcx : TyCtxt < ' tcx > ,
966
- impl_m : & ty:: AssocItem ,
967
- trait_m : & ty:: AssocItem ,
966
+ impl_m : ty:: AssocItem ,
967
+ trait_m : ty:: AssocItem ,
968
968
delay : bool ,
969
969
) -> Result < ( ) , ErrorGuaranteed > {
970
970
let impl_generics = tcx. generics_of ( impl_m. def_id ) ;
@@ -1038,7 +1038,7 @@ fn check_region_bounds_on_impl_item<'tcx>(
1038
1038
. sess
1039
1039
. create_err ( LifetimesOrBoundsMismatchOnTrait {
1040
1040
span,
1041
- item_kind : assoc_item_kind_str ( impl_m) ,
1041
+ item_kind : assoc_item_kind_str ( & impl_m) ,
1042
1042
ident : impl_m. ident ( tcx) ,
1043
1043
generics_span,
1044
1044
bounds_span,
@@ -1056,8 +1056,8 @@ fn extract_spans_for_error_reporting<'tcx>(
1056
1056
infcx : & infer:: InferCtxt < ' tcx > ,
1057
1057
terr : TypeError < ' _ > ,
1058
1058
cause : & ObligationCause < ' tcx > ,
1059
- impl_m : & ty:: AssocItem ,
1060
- trait_m : & ty:: AssocItem ,
1059
+ impl_m : ty:: AssocItem ,
1060
+ trait_m : ty:: AssocItem ,
1061
1061
) -> ( Span , Option < Span > ) {
1062
1062
let tcx = infcx. tcx ;
1063
1063
let mut impl_args = {
@@ -1080,8 +1080,8 @@ fn extract_spans_for_error_reporting<'tcx>(
1080
1080
1081
1081
fn compare_self_type < ' tcx > (
1082
1082
tcx : TyCtxt < ' tcx > ,
1083
- impl_m : & ty:: AssocItem ,
1084
- trait_m : & ty:: AssocItem ,
1083
+ impl_m : ty:: AssocItem ,
1084
+ trait_m : ty:: AssocItem ,
1085
1085
impl_trait_ref : ty:: TraitRef < ' tcx > ,
1086
1086
) -> Result < ( ) , ErrorGuaranteed > {
1087
1087
// Try to give more informative error messages about self typing
@@ -1092,7 +1092,7 @@ fn compare_self_type<'tcx>(
1092
1092
// inscrutable, particularly for cases where one method has no
1093
1093
// self.
1094
1094
1095
- let self_string = |method : & ty:: AssocItem | {
1095
+ let self_string = |method : ty:: AssocItem | {
1096
1096
let untransformed_self_ty = match method. container {
1097
1097
ty:: ImplContainer => impl_trait_ref. self_ty ( ) ,
1098
1098
ty:: TraitContainer => tcx. types . self_param ,
@@ -1182,8 +1182,8 @@ fn compare_self_type<'tcx>(
1182
1182
/// [`compare_generic_param_kinds`]. This function also does not handle lifetime parameters
1183
1183
fn compare_number_of_generics < ' tcx > (
1184
1184
tcx : TyCtxt < ' tcx > ,
1185
- impl_ : & ty:: AssocItem ,
1186
- trait_ : & ty:: AssocItem ,
1185
+ impl_ : ty:: AssocItem ,
1186
+ trait_ : ty:: AssocItem ,
1187
1187
delay : bool ,
1188
1188
) -> Result < ( ) , ErrorGuaranteed > {
1189
1189
let trait_own_counts = tcx. generics_of ( trait_. def_id ) . own_counts ( ) ;
@@ -1203,7 +1203,7 @@ fn compare_number_of_generics<'tcx>(
1203
1203
( "const" , trait_own_counts. consts , impl_own_counts. consts ) ,
1204
1204
] ;
1205
1205
1206
- let item_kind = assoc_item_kind_str ( impl_) ;
1206
+ let item_kind = assoc_item_kind_str ( & impl_) ;
1207
1207
1208
1208
let mut err_occurred = None ;
1209
1209
for ( kind, trait_count, impl_count) in matchings {
@@ -1325,8 +1325,8 @@ fn compare_number_of_generics<'tcx>(
1325
1325
1326
1326
fn compare_number_of_method_arguments < ' tcx > (
1327
1327
tcx : TyCtxt < ' tcx > ,
1328
- impl_m : & ty:: AssocItem ,
1329
- trait_m : & ty:: AssocItem ,
1328
+ impl_m : ty:: AssocItem ,
1329
+ trait_m : ty:: AssocItem ,
1330
1330
) -> Result < ( ) , ErrorGuaranteed > {
1331
1331
let impl_m_fty = tcx. fn_sig ( impl_m. def_id ) ;
1332
1332
let trait_m_fty = tcx. fn_sig ( trait_m. def_id ) ;
@@ -1405,8 +1405,8 @@ fn compare_number_of_method_arguments<'tcx>(
1405
1405
1406
1406
fn compare_synthetic_generics < ' tcx > (
1407
1407
tcx : TyCtxt < ' tcx > ,
1408
- impl_m : & ty:: AssocItem ,
1409
- trait_m : & ty:: AssocItem ,
1408
+ impl_m : ty:: AssocItem ,
1409
+ trait_m : ty:: AssocItem ,
1410
1410
) -> Result < ( ) , ErrorGuaranteed > {
1411
1411
// FIXME(chrisvittal) Clean up this function, list of FIXME items:
1412
1412
// 1. Better messages for the span labels
@@ -1559,8 +1559,8 @@ fn compare_synthetic_generics<'tcx>(
1559
1559
/// This function does not handle lifetime parameters
1560
1560
fn compare_generic_param_kinds < ' tcx > (
1561
1561
tcx : TyCtxt < ' tcx > ,
1562
- impl_item : & ty:: AssocItem ,
1563
- trait_item : & ty:: AssocItem ,
1562
+ impl_item : ty:: AssocItem ,
1563
+ trait_item : ty:: AssocItem ,
1564
1564
delay : bool ,
1565
1565
) -> Result < ( ) , ErrorGuaranteed > {
1566
1566
assert_eq ! ( impl_item. kind, trait_item. kind) ;
@@ -1736,8 +1736,8 @@ pub(super) fn compare_impl_const_raw(
1736
1736
1737
1737
pub ( super ) fn compare_impl_ty < ' tcx > (
1738
1738
tcx : TyCtxt < ' tcx > ,
1739
- impl_ty : & ty:: AssocItem ,
1740
- trait_ty : & ty:: AssocItem ,
1739
+ impl_ty : ty:: AssocItem ,
1740
+ trait_ty : ty:: AssocItem ,
1741
1741
impl_trait_ref : ty:: TraitRef < ' tcx > ,
1742
1742
) {
1743
1743
debug ! ( "compare_impl_type(impl_trait_ref={:?})" , impl_trait_ref) ;
@@ -1754,8 +1754,8 @@ pub(super) fn compare_impl_ty<'tcx>(
1754
1754
/// instead of associated functions.
1755
1755
fn compare_type_predicate_entailment < ' tcx > (
1756
1756
tcx : TyCtxt < ' tcx > ,
1757
- impl_ty : & ty:: AssocItem ,
1758
- trait_ty : & ty:: AssocItem ,
1757
+ impl_ty : ty:: AssocItem ,
1758
+ trait_ty : ty:: AssocItem ,
1759
1759
impl_trait_ref : ty:: TraitRef < ' tcx > ,
1760
1760
) -> Result < ( ) , ErrorGuaranteed > {
1761
1761
let impl_substs = InternalSubsts :: identity_for_item ( tcx, impl_ty. def_id ) ;
@@ -1855,8 +1855,8 @@ fn compare_type_predicate_entailment<'tcx>(
1855
1855
#[ instrument( level = "debug" , skip( tcx) ) ]
1856
1856
pub ( super ) fn check_type_bounds < ' tcx > (
1857
1857
tcx : TyCtxt < ' tcx > ,
1858
- trait_ty : & ty:: AssocItem ,
1859
- impl_ty : & ty:: AssocItem ,
1858
+ trait_ty : ty:: AssocItem ,
1859
+ impl_ty : ty:: AssocItem ,
1860
1860
impl_trait_ref : ty:: TraitRef < ' tcx > ,
1861
1861
) -> Result < ( ) , ErrorGuaranteed > {
1862
1862
// Given
0 commit comments