@@ -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 ! [ ] ;
@@ -480,7 +480,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for RemapLateBound<'_, 'tcx> {
480
480
481
481
fn emit_implied_wf_lint < ' tcx > (
482
482
tcx : TyCtxt < ' tcx > ,
483
- impl_m : & ty:: AssocItem ,
483
+ impl_m : ty:: AssocItem ,
484
484
hir_id : hir:: HirId ,
485
485
bad_args : Vec < ( Span , Option < String > ) > ,
486
486
) {
@@ -527,8 +527,8 @@ enum CheckImpliedWfMode {
527
527
528
528
fn compare_asyncness < ' tcx > (
529
529
tcx : TyCtxt < ' tcx > ,
530
- impl_m : & ty:: AssocItem ,
531
- trait_m : & ty:: AssocItem ,
530
+ impl_m : ty:: AssocItem ,
531
+ trait_m : ty:: AssocItem ,
532
532
) -> Result < ( ) , ErrorGuaranteed > {
533
533
if tcx. asyncness ( trait_m. def_id ) == hir:: IsAsync :: Async {
534
534
match tcx. fn_sig ( impl_m. def_id ) . skip_binder ( ) . skip_binder ( ) . output ( ) . kind ( ) {
@@ -873,8 +873,8 @@ fn report_trait_method_mismatch<'tcx>(
873
873
infcx : & InferCtxt < ' tcx > ,
874
874
mut cause : ObligationCause < ' tcx > ,
875
875
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 > ) ,
878
878
impl_trait_ref : ty:: TraitRef < ' tcx > ,
879
879
) -> ErrorGuaranteed {
880
880
let tcx = infcx. tcx ;
@@ -967,8 +967,8 @@ fn report_trait_method_mismatch<'tcx>(
967
967
968
968
fn check_region_bounds_on_impl_item < ' tcx > (
969
969
tcx : TyCtxt < ' tcx > ,
970
- impl_m : & ty:: AssocItem ,
971
- trait_m : & ty:: AssocItem ,
970
+ impl_m : ty:: AssocItem ,
971
+ trait_m : ty:: AssocItem ,
972
972
delay : bool ,
973
973
) -> Result < ( ) , ErrorGuaranteed > {
974
974
let impl_generics = tcx. generics_of ( impl_m. def_id ) ;
@@ -1042,7 +1042,7 @@ fn check_region_bounds_on_impl_item<'tcx>(
1042
1042
. sess
1043
1043
. create_err ( LifetimesOrBoundsMismatchOnTrait {
1044
1044
span,
1045
- item_kind : assoc_item_kind_str ( impl_m) ,
1045
+ item_kind : assoc_item_kind_str ( & impl_m) ,
1046
1046
ident : impl_m. ident ( tcx) ,
1047
1047
generics_span,
1048
1048
bounds_span,
@@ -1060,8 +1060,8 @@ fn extract_spans_for_error_reporting<'tcx>(
1060
1060
infcx : & infer:: InferCtxt < ' tcx > ,
1061
1061
terr : TypeError < ' _ > ,
1062
1062
cause : & ObligationCause < ' tcx > ,
1063
- impl_m : & ty:: AssocItem ,
1064
- trait_m : & ty:: AssocItem ,
1063
+ impl_m : ty:: AssocItem ,
1064
+ trait_m : ty:: AssocItem ,
1065
1065
) -> ( Span , Option < Span > ) {
1066
1066
let tcx = infcx. tcx ;
1067
1067
let mut impl_args = {
@@ -1084,8 +1084,8 @@ fn extract_spans_for_error_reporting<'tcx>(
1084
1084
1085
1085
fn compare_self_type < ' tcx > (
1086
1086
tcx : TyCtxt < ' tcx > ,
1087
- impl_m : & ty:: AssocItem ,
1088
- trait_m : & ty:: AssocItem ,
1087
+ impl_m : ty:: AssocItem ,
1088
+ trait_m : ty:: AssocItem ,
1089
1089
impl_trait_ref : ty:: TraitRef < ' tcx > ,
1090
1090
) -> Result < ( ) , ErrorGuaranteed > {
1091
1091
// Try to give more informative error messages about self typing
@@ -1096,7 +1096,7 @@ fn compare_self_type<'tcx>(
1096
1096
// inscrutable, particularly for cases where one method has no
1097
1097
// self.
1098
1098
1099
- let self_string = |method : & ty:: AssocItem | {
1099
+ let self_string = |method : ty:: AssocItem | {
1100
1100
let untransformed_self_ty = match method. container {
1101
1101
ty:: ImplContainer => impl_trait_ref. self_ty ( ) ,
1102
1102
ty:: TraitContainer => tcx. types . self_param ,
@@ -1186,8 +1186,8 @@ fn compare_self_type<'tcx>(
1186
1186
/// [`compare_generic_param_kinds`]. This function also does not handle lifetime parameters
1187
1187
fn compare_number_of_generics < ' tcx > (
1188
1188
tcx : TyCtxt < ' tcx > ,
1189
- impl_ : & ty:: AssocItem ,
1190
- trait_ : & ty:: AssocItem ,
1189
+ impl_ : ty:: AssocItem ,
1190
+ trait_ : ty:: AssocItem ,
1191
1191
delay : bool ,
1192
1192
) -> Result < ( ) , ErrorGuaranteed > {
1193
1193
let trait_own_counts = tcx. generics_of ( trait_. def_id ) . own_counts ( ) ;
@@ -1207,7 +1207,7 @@ fn compare_number_of_generics<'tcx>(
1207
1207
( "const" , trait_own_counts. consts , impl_own_counts. consts ) ,
1208
1208
] ;
1209
1209
1210
- let item_kind = assoc_item_kind_str ( impl_) ;
1210
+ let item_kind = assoc_item_kind_str ( & impl_) ;
1211
1211
1212
1212
let mut err_occurred = None ;
1213
1213
for ( kind, trait_count, impl_count) in matchings {
@@ -1329,8 +1329,8 @@ fn compare_number_of_generics<'tcx>(
1329
1329
1330
1330
fn compare_number_of_method_arguments < ' tcx > (
1331
1331
tcx : TyCtxt < ' tcx > ,
1332
- impl_m : & ty:: AssocItem ,
1333
- trait_m : & ty:: AssocItem ,
1332
+ impl_m : ty:: AssocItem ,
1333
+ trait_m : ty:: AssocItem ,
1334
1334
) -> Result < ( ) , ErrorGuaranteed > {
1335
1335
let impl_m_fty = tcx. fn_sig ( impl_m. def_id ) ;
1336
1336
let trait_m_fty = tcx. fn_sig ( trait_m. def_id ) ;
@@ -1409,8 +1409,8 @@ fn compare_number_of_method_arguments<'tcx>(
1409
1409
1410
1410
fn compare_synthetic_generics < ' tcx > (
1411
1411
tcx : TyCtxt < ' tcx > ,
1412
- impl_m : & ty:: AssocItem ,
1413
- trait_m : & ty:: AssocItem ,
1412
+ impl_m : ty:: AssocItem ,
1413
+ trait_m : ty:: AssocItem ,
1414
1414
) -> Result < ( ) , ErrorGuaranteed > {
1415
1415
// FIXME(chrisvittal) Clean up this function, list of FIXME items:
1416
1416
// 1. Better messages for the span labels
@@ -1563,8 +1563,8 @@ fn compare_synthetic_generics<'tcx>(
1563
1563
/// This function does not handle lifetime parameters
1564
1564
fn compare_generic_param_kinds < ' tcx > (
1565
1565
tcx : TyCtxt < ' tcx > ,
1566
- impl_item : & ty:: AssocItem ,
1567
- trait_item : & ty:: AssocItem ,
1566
+ impl_item : ty:: AssocItem ,
1567
+ trait_item : ty:: AssocItem ,
1568
1568
delay : bool ,
1569
1569
) -> Result < ( ) , ErrorGuaranteed > {
1570
1570
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