@@ -387,42 +387,42 @@ fn resolve_negative_obligation<'cx, 'tcx>(
387
387
) -> bool {
388
388
let tcx = infcx. tcx ;
389
389
390
- if let Some ( o) = o. flip_polarity ( tcx) {
391
- let mut fulfillment_cx = FulfillmentContext :: new ( ) ;
392
- fulfillment_cx . register_predicate_obligation ( infcx , o ) ;
390
+ let Some ( o) = o. flip_polarity ( tcx) else {
391
+ return false ;
392
+ } ;
393
393
394
- let errors = fulfillment_cx. select_all_or_error ( infcx) ;
394
+ let mut fulfillment_cx = FulfillmentContext :: new ( ) ;
395
+ fulfillment_cx. register_predicate_obligation ( infcx, o) ;
395
396
396
- if !errors. is_empty ( ) {
397
- return false ;
398
- }
397
+ let errors = fulfillment_cx. select_all_or_error ( infcx) ;
399
398
400
- let mut outlives_env = OutlivesEnvironment :: new ( param_env) ;
401
- // FIXME -- add "assumed to be well formed" types into the `outlives_env`
399
+ if !errors. is_empty ( ) {
400
+ return false ;
401
+ }
402
402
403
- // "Save" the accumulated implied bounds into the outlives environment
404
- // (due to the FIXME above, there aren't any, but this step is still needed).
405
- // The "body id" is given as `CRATE_HIR_ID`, which is the same body-id used
406
- // by the "dummy" causes elsewhere (body-id is only relevant when checking
407
- // function bodies with closures).
408
- outlives_env. save_implied_bounds ( CRATE_HIR_ID ) ;
403
+ let mut outlives_env = OutlivesEnvironment :: new ( param_env) ;
404
+ // FIXME -- add "assumed to be well formed" types into the `outlives_env`
409
405
410
- infcx. process_registered_region_obligations (
411
- outlives_env. region_bound_pairs_map ( ) ,
412
- Some ( tcx. lifetimes . re_root_empty ) ,
413
- param_env,
414
- ) ;
406
+ // "Save" the accumulated implied bounds into the outlives environment
407
+ // (due to the FIXME above, there aren't any, but this step is still needed).
408
+ // The "body id" is given as `CRATE_HIR_ID`, which is the same body-id used
409
+ // by the "dummy" causes elsewhere (body-id is only relevant when checking
410
+ // function bodies with closures).
411
+ outlives_env. save_implied_bounds ( CRATE_HIR_ID ) ;
415
412
416
- let errors = infcx. resolve_regions ( region_context, & outlives_env, RegionckMode :: default ( ) ) ;
413
+ infcx. process_registered_region_obligations (
414
+ outlives_env. region_bound_pairs_map ( ) ,
415
+ Some ( tcx. lifetimes . re_root_empty ) ,
416
+ param_env,
417
+ ) ;
417
418
418
- if !errors. is_empty ( ) {
419
- return false ;
420
- }
419
+ let errors = infcx. resolve_regions ( region_context, & outlives_env, RegionckMode :: default ( ) ) ;
421
420
422
- return true ;
421
+ if !errors. is_empty ( ) {
422
+ return false ;
423
423
}
424
424
425
- false
425
+ true
426
426
}
427
427
428
428
pub fn trait_ref_is_knowable < ' tcx > (
0 commit comments