@@ -13,6 +13,7 @@ use rustc_infer::infer::outlives::obligations::TypeOutlives;
1313use rustc_infer:: infer:: { self , InferCtxt , TyCtxtInferExt } ;
1414use rustc_middle:: mir:: ConstraintCategory ;
1515use rustc_middle:: query:: Providers ;
16+ use rustc_middle:: ty:: print:: with_no_trimmed_paths;
1617use rustc_middle:: ty:: trait_def:: TraitSpecializationKind ;
1718use rustc_middle:: ty:: {
1819 self , AdtKind , GenericParamDefKind , ToPredicate , Ty , TyCtxt , TypeFoldable , TypeSuperVisitable ,
@@ -126,6 +127,7 @@ where
126127
127128 let infcx_compat = infcx. fork ( ) ;
128129
130+ debug ! ( ?assumed_wf_types) ;
129131 let implied_bounds = infcx. implied_bounds_tys ( param_env, & assumed_wf_types) ;
130132 let outlives_env = OutlivesEnvironment :: with_bounds ( param_env, implied_bounds) ;
131133
@@ -135,13 +137,26 @@ where
135137 }
136138
137139 let implied_bounds =
138- infcx_compat. implied_bounds_tys_compat ( param_env, body_def_id, assumed_wf_types) ;
140+ infcx_compat. implied_bounds_tys_compat ( param_env, body_def_id, & assumed_wf_types) ;
139141 let outlives_env = OutlivesEnvironment :: with_bounds ( param_env, implied_bounds) ;
140142 let errors_compat = infcx_compat. resolve_regions ( & outlives_env) ;
141143 if !errors_compat. is_empty ( ) {
142144 return Err ( infcx_compat. err_ctxt ( ) . report_region_errors ( body_def_id, & errors_compat) ) ;
143145 }
144146
147+ // We don't want to emit this for dependents of Bevy, for now.
148+ for ty in assumed_wf_types. iter ( ) {
149+ match ty. kind ( ) {
150+ ty:: Adt ( def, _) => {
151+ let adt_did = with_no_trimmed_paths ! ( infcx. tcx. def_path_str( def. 0 . did) ) ;
152+ if adt_did == "bevy_ecs::system::ParamSet" {
153+ return Ok ( ( ) ) ;
154+ }
155+ }
156+ _ => { }
157+ }
158+ }
159+
145160 let hir_id = tcx. local_def_id_to_hir_id ( body_def_id) ;
146161 let ( lint_level, _) = tcx
147162 . lint_level_at_node ( rustc_session:: lint:: builtin:: IMPLIED_BOUNDS_FROM_TRAIT_IMPL , hir_id) ;
@@ -752,7 +767,7 @@ fn resolve_regions_with_wf_tys<'tcx>(
752767 let infcx = tcx. infer_ctxt ( ) . build ( ) ;
753768 let outlives_environment = OutlivesEnvironment :: with_bounds (
754769 param_env,
755- infcx. implied_bounds_tys_compat ( param_env, id, wf_tys. clone ( ) ) ,
770+ infcx. implied_bounds_tys_compat ( param_env, id, wf_tys) ,
756771 ) ;
757772 let region_bound_pairs = outlives_environment. region_bound_pairs ( ) ;
758773
0 commit comments