@@ -13,6 +13,7 @@ use rustc_infer::infer::outlives::obligations::TypeOutlives;
13
13
use rustc_infer:: infer:: { self , InferCtxt , TyCtxtInferExt } ;
14
14
use rustc_middle:: mir:: ConstraintCategory ;
15
15
use rustc_middle:: query:: Providers ;
16
+ use rustc_middle:: ty:: print:: with_no_trimmed_paths;
16
17
use rustc_middle:: ty:: trait_def:: TraitSpecializationKind ;
17
18
use rustc_middle:: ty:: {
18
19
self , AdtKind , GenericParamDefKind , ToPredicate , Ty , TyCtxt , TypeFoldable , TypeSuperVisitable ,
@@ -126,6 +127,7 @@ where
126
127
127
128
let infcx_compat = infcx. fork ( ) ;
128
129
130
+ debug ! ( ?assumed_wf_types) ;
129
131
let implied_bounds = infcx. implied_bounds_tys ( param_env, & assumed_wf_types) ;
130
132
let outlives_env = OutlivesEnvironment :: with_bounds ( param_env, implied_bounds) ;
131
133
@@ -135,13 +137,26 @@ where
135
137
}
136
138
137
139
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) ;
139
141
let outlives_env = OutlivesEnvironment :: with_bounds ( param_env, implied_bounds) ;
140
142
let errors_compat = infcx_compat. resolve_regions ( & outlives_env) ;
141
143
if !errors_compat. is_empty ( ) {
142
144
return Err ( infcx_compat. err_ctxt ( ) . report_region_errors ( body_def_id, & errors_compat) ) ;
143
145
}
144
146
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
+
145
160
let hir_id = tcx. local_def_id_to_hir_id ( body_def_id) ;
146
161
let ( lint_level, _) = tcx
147
162
. 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>(
752
767
let infcx = tcx. infer_ctxt ( ) . build ( ) ;
753
768
let outlives_environment = OutlivesEnvironment :: with_bounds (
754
769
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) ,
756
771
) ;
757
772
let region_bound_pairs = outlives_environment. region_bound_pairs ( ) ;
758
773
0 commit comments