@@ -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" ) ) ) ,
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
false ,
@@ -621,6 +625,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
621
625
let emitted = report_trait_method_mismatch (
622
626
infcx,
623
627
cause,
628
+ param_env,
624
629
terr,
625
630
( trait_m, trait_sig) ,
626
631
( impl_m, impl_sig) ,
@@ -934,6 +939,7 @@ impl<'tcx> ty::FallibleTypeFolder<TyCtxt<'tcx>> for RemapHiddenTyRegions<'tcx> {
934
939
fn report_trait_method_mismatch < ' tcx > (
935
940
infcx : & InferCtxt < ' tcx > ,
936
941
mut cause : ObligationCause < ' tcx > ,
942
+ param_env : ty:: ParamEnv < ' tcx > ,
937
943
terr : TypeError < ' tcx > ,
938
944
( trait_m, trait_sig) : ( ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
939
945
( impl_m, impl_sig) : ( ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
@@ -1019,10 +1025,13 @@ fn report_trait_method_mismatch<'tcx>(
1019
1025
& mut diag,
1020
1026
& cause,
1021
1027
trait_err_span. map ( |sp| ( sp, Cow :: from ( "type in trait" ) ) ) ,
1022
- Some ( infer:: ValuePairs :: PolySigs ( ExpectedFound {
1023
- expected : ty:: Binder :: dummy ( trait_sig) ,
1024
- found : ty:: Binder :: dummy ( impl_sig) ,
1025
- } ) ) ,
1028
+ Some ( (
1029
+ infer:: ValuePairs :: PolySigs ( ExpectedFound {
1030
+ expected : ty:: Binder :: dummy ( trait_sig) ,
1031
+ found : ty:: Binder :: dummy ( impl_sig) ,
1032
+ } ) ,
1033
+ param_env,
1034
+ ) ) ,
1026
1035
terr,
1027
1036
false ,
1028
1037
false ,
@@ -1826,10 +1835,13 @@ fn compare_const_predicate_entailment<'tcx>(
1826
1835
& mut diag,
1827
1836
& cause,
1828
1837
trait_c_span. map ( |span| ( span, Cow :: from ( "type in trait" ) ) ) ,
1829
- Some ( infer:: ValuePairs :: Terms ( ExpectedFound {
1830
- expected : trait_ty. into ( ) ,
1831
- found : impl_ty. into ( ) ,
1832
- } ) ) ,
1838
+ Some ( (
1839
+ infer:: ValuePairs :: Terms ( ExpectedFound {
1840
+ expected : trait_ty. into ( ) ,
1841
+ found : impl_ty. into ( ) ,
1842
+ } ) ,
1843
+ param_env,
1844
+ ) ) ,
1833
1845
terr,
1834
1846
false ,
1835
1847
false ,
0 commit comments