@@ -7,7 +7,7 @@ use rustc_infer::infer::region_constraints::GenericKind;
7
7
use rustc_infer:: infer:: InferCtxt ;
8
8
use rustc_middle:: mir:: ConstraintCategory ;
9
9
use rustc_middle:: traits:: query:: OutlivesBound ;
10
- use rustc_middle:: ty:: { self , RegionVid , ToPredicate , Ty } ;
10
+ use rustc_middle:: ty:: { self , RegionVid , Ty } ;
11
11
use rustc_span:: { Span , DUMMY_SP } ;
12
12
use rustc_trait_selection:: traits:: query:: type_op:: { self , TypeOp } ;
13
13
use std:: rc:: Rc ;
@@ -232,21 +232,14 @@ impl<'tcx> UniversalRegionRelationsBuilder<'_, 'tcx> {
232
232
let mut normalized_inputs_and_output =
233
233
Vec :: with_capacity ( self . universal_regions . unnormalized_input_tys . len ( ) + 1 ) ;
234
234
let mut constraints = vec ! [ ] ;
235
- for ( i , ty ) in unnormalized_input_output_tys. enumerate ( ) {
235
+ for ty in unnormalized_input_output_tys {
236
236
debug ! ( "build: input_or_output={:?}" , ty) ;
237
-
238
- let use_implied_bounds = i < self . universal_regions . unnormalized_input_tys . len ( )
239
- || self . universal_regions . defining_ty . is_fn_def ( ) ;
240
-
241
237
// We add implied bounds from both the unnormalized and normalized ty.
242
238
// See issue #87748
243
- if use_implied_bounds {
244
- let constraints_unnorm = self . add_implied_bounds ( ty) ;
245
- if let Some ( c) = constraints_unnorm {
246
- constraints. push ( c)
247
- }
239
+ let constraints_unnorm = self . add_implied_bounds ( ty) ;
240
+ if let Some ( c) = constraints_unnorm {
241
+ constraints. push ( c)
248
242
}
249
-
250
243
let TypeOpOutput { output : norm_ty, constraints : constraints_normalize, .. } = self
251
244
. param_env
252
245
. and ( type_op:: normalize:: Normalize :: new ( ty) )
@@ -272,7 +265,7 @@ impl<'tcx> UniversalRegionRelationsBuilder<'_, 'tcx> {
272
265
// }
273
266
// ```
274
267
// Both &Self::Bar and &() are WF
275
- if use_implied_bounds && ty != norm_ty {
268
+ if ty != norm_ty {
276
269
let constraints_norm = self . add_implied_bounds ( norm_ty) ;
277
270
if let Some ( c) = constraints_norm {
278
271
constraints. push ( c)
@@ -282,22 +275,6 @@ impl<'tcx> UniversalRegionRelationsBuilder<'_, 'tcx> {
282
275
normalized_inputs_and_output. push ( norm_ty) ;
283
276
}
284
277
285
- let TypeOpOutput { constraints : constraints_wf, .. } = self
286
- . param_env
287
- . and ( type_op:: ProvePredicate :: new (
288
- ty:: ClauseKind :: WellFormed ( ( * normalized_inputs_and_output. last ( ) . unwrap ( ) ) . into ( ) )
289
- . to_predicate ( self . infcx . tcx ) ,
290
- ) )
291
- . fully_perform ( self . infcx , span)
292
- . unwrap_or_else ( |_: rustc_span:: ErrorGuaranteed | TypeOpOutput {
293
- output : ( ) ,
294
- constraints : None ,
295
- error_info : None ,
296
- } ) ;
297
- if let Some ( c) = constraints_wf {
298
- constraints. push ( c)
299
- }
300
-
301
278
for c in constraints {
302
279
self . push_region_constraints ( c, span) ;
303
280
}
0 commit comments