@@ -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" ) ) ) ,
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 false ,
@@ -621,6 +625,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
621625 let emitted = report_trait_method_mismatch (
622626 infcx,
623627 cause,
628+ param_env,
624629 terr,
625630 ( trait_m, trait_sig) ,
626631 ( impl_m, impl_sig) ,
@@ -934,6 +939,7 @@ impl<'tcx> ty::FallibleTypeFolder<TyCtxt<'tcx>> for RemapHiddenTyRegions<'tcx> {
934939fn report_trait_method_mismatch < ' tcx > (
935940 infcx : & InferCtxt < ' tcx > ,
936941 mut cause : ObligationCause < ' tcx > ,
942+ param_env : ty:: ParamEnv < ' tcx > ,
937943 terr : TypeError < ' tcx > ,
938944 ( trait_m, trait_sig) : ( ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
939945 ( impl_m, impl_sig) : ( ty:: AssocItem , ty:: FnSig < ' tcx > ) ,
@@ -1019,10 +1025,13 @@ fn report_trait_method_mismatch<'tcx>(
10191025 & mut diag,
10201026 & cause,
10211027 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+ ) ) ,
10261035 terr,
10271036 false ,
10281037 false ,
@@ -1826,10 +1835,13 @@ fn compare_const_predicate_entailment<'tcx>(
18261835 & mut diag,
18271836 & cause,
18281837 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+ ) ) ,
18331845 terr,
18341846 false ,
18351847 false ,
0 commit comments