@@ -298,6 +298,7 @@ fn compare_method_predicate_entailment<'tcx>(
298
298
let emitted = report_trait_method_mismatch (
299
299
infcx,
300
300
cause,
301
+ param_env,
301
302
terr,
302
303
( trait_m, trait_sig) ,
303
304
( impl_m, impl_sig) ,
@@ -593,10 +594,13 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
593
594
hir. get_if_local ( impl_m. def_id )
594
595
. and_then ( |node| node. fn_decl ( ) )
595
596
. map ( |decl| ( decl. output . span ( ) , Cow :: from ( "return type in trait" ) , false ) ) ,
596
- Some ( infer:: ValuePairs :: Terms ( ExpectedFound {
597
- expected : trait_return_ty. into ( ) ,
598
- found : impl_return_ty. into ( ) ,
599
- } ) ) ,
597
+ Some ( (
598
+ infer:: ValuePairs :: Terms ( ExpectedFound {
599
+ expected : trait_return_ty. into ( ) ,
600
+ found : impl_return_ty. into ( ) ,
601
+ } ) ,
602
+ param_env,
603
+ ) ) ,
600
604
terr,
601
605
false ,
602
606
) ;
@@ -620,6 +624,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
620
624
let emitted = report_trait_method_mismatch (
621
625
infcx,
622
626
cause,
627
+ param_env,
623
628
terr,
624
629
( trait_m, trait_sig) ,
625
630
( impl_m, impl_sig) ,
@@ -933,6 +938,7 @@ impl<'tcx> ty::FallibleTypeFolder<TyCtxt<'tcx>> for RemapHiddenTyRegions<'tcx> {
933
938
fn report_trait_method_mismatch < ' tcx > (
934
939
infcx : & InferCtxt < ' tcx > ,
935
940
mut cause : ObligationCause < ' tcx > ,
941
+ param_env : ty:: ParamEnv < ' tcx > ,
936
942
terr : TypeError < ' tcx > ,
937
943
( trait_m, trait_sig) : ( ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
938
944
( impl_m, impl_sig) : ( ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
@@ -1018,10 +1024,13 @@ fn report_trait_method_mismatch<'tcx>(
1018
1024
& mut diag,
1019
1025
& cause,
1020
1026
trait_err_span. map ( |sp| ( sp, Cow :: from ( "type in trait" ) , false ) ) ,
1021
- Some ( infer:: ValuePairs :: PolySigs ( ExpectedFound {
1022
- expected : ty:: Binder :: dummy ( trait_sig) ,
1023
- found : ty:: Binder :: dummy ( impl_sig) ,
1024
- } ) ) ,
1027
+ Some ( (
1028
+ infer:: ValuePairs :: PolySigs ( ExpectedFound {
1029
+ expected : ty:: Binder :: dummy ( trait_sig) ,
1030
+ found : ty:: Binder :: dummy ( impl_sig) ,
1031
+ } ) ,
1032
+ param_env,
1033
+ ) ) ,
1025
1034
terr,
1026
1035
false ,
1027
1036
) ;
@@ -1824,10 +1833,13 @@ fn compare_const_predicate_entailment<'tcx>(
1824
1833
& mut diag,
1825
1834
& cause,
1826
1835
trait_c_span. map ( |span| ( span, Cow :: from ( "type in trait" ) , false ) ) ,
1827
- Some ( infer:: ValuePairs :: Terms ( ExpectedFound {
1828
- expected : trait_ty. into ( ) ,
1829
- found : impl_ty. into ( ) ,
1830
- } ) ) ,
1836
+ Some ( (
1837
+ infer:: ValuePairs :: Terms ( ExpectedFound {
1838
+ expected : trait_ty. into ( ) ,
1839
+ found : impl_ty. into ( ) ,
1840
+ } ) ,
1841
+ param_env,
1842
+ ) ) ,
1831
1843
terr,
1832
1844
false ,
1833
1845
) ;
0 commit comments