@@ -298,6 +298,7 @@ fn compare_method_predicate_entailment<'tcx>(
298298 let emitted = report_trait_method_mismatch (
299299 infcx,
300300 cause,
301+ param_env,
301302 terr,
302303 ( trait_m, trait_sig) ,
303304 ( impl_m, impl_sig) ,
@@ -593,10 +594,13 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
593594 hir. get_if_local ( impl_m. def_id )
594595 . and_then ( |node| node. fn_decl ( ) )
595596 . 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+ ) ) ,
600604 terr,
601605 false ,
602606 ) ;
@@ -620,6 +624,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
620624 let emitted = report_trait_method_mismatch (
621625 infcx,
622626 cause,
627+ param_env,
623628 terr,
624629 ( trait_m, trait_sig) ,
625630 ( impl_m, impl_sig) ,
@@ -933,6 +938,7 @@ impl<'tcx> ty::FallibleTypeFolder<TyCtxt<'tcx>> for RemapHiddenTyRegions<'tcx> {
933938fn report_trait_method_mismatch < ' tcx > (
934939 infcx : & InferCtxt < ' tcx > ,
935940 mut cause : ObligationCause < ' tcx > ,
941+ param_env : ty:: ParamEnv < ' tcx > ,
936942 terr : TypeError < ' tcx > ,
937943 ( trait_m, trait_sig) : ( ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
938944 ( impl_m, impl_sig) : ( ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
@@ -1018,10 +1024,13 @@ fn report_trait_method_mismatch<'tcx>(
10181024 & mut diag,
10191025 & cause,
10201026 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+ ) ) ,
10251034 terr,
10261035 false ,
10271036 ) ;
@@ -1824,10 +1833,13 @@ fn compare_const_predicate_entailment<'tcx>(
18241833 & mut diag,
18251834 & cause,
18261835 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+ ) ) ,
18311843 terr,
18321844 false ,
18331845 ) ;
0 commit comments