diff options
| author | lcnr <rust@lcnr.de> | 2024-12-03 18:42:09 +0100 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2024-12-04 16:39:42 +0100 |
| commit | baf4bb7100e770fb4cf052c07d408a9dd97d6e96 (patch) | |
| tree | b686429ae014f82d39daf60d5c92195d30b3f204 | |
| parent | 96e51d9482405e400dec53750f3b263d45784ada (diff) | |
| download | rust-baf4bb7100e770fb4cf052c07d408a9dd97d6e96.tar.gz rust-baf4bb7100e770fb4cf052c07d408a9dd97d6e96.zip | |
remove unnecessary `eval_verify_bound`
| -rw-r--r-- | compiler/rustc_borrowck/src/region_infer/mod.rs | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/compiler/rustc_borrowck/src/region_infer/mod.rs b/compiler/rustc_borrowck/src/region_infer/mod.rs index 0eecf98a6ed..fd58de6497d 100644 --- a/compiler/rustc_borrowck/src/region_infer/mod.rs +++ b/compiler/rustc_borrowck/src/region_infer/mod.rs @@ -973,7 +973,7 @@ impl<'tcx> RegionInferenceContext<'tcx> { propagated_outlives_requirements: &mut Vec<ClosureOutlivesRequirement<'tcx>>, ) -> bool { let tcx = infcx.tcx; - let TypeTest { generic_kind, lower_bound, span: blame_span, ref verify_bound } = *type_test; + let TypeTest { generic_kind, lower_bound, span: blame_span, verify_bound: _ } = *type_test; let generic_ty = generic_kind.to_ty(tcx); let Some(subject) = self.try_promote_type_test_subject(infcx, generic_ty) else { @@ -1013,23 +1013,6 @@ impl<'tcx> RegionInferenceContext<'tcx> { // `ClosureOutlivesRequirement`. for ur in self.scc_values.universal_regions_outlived_by(r_scc) { debug!("universal_region_outlived_by ur={:?}", ur); - // Check whether we can already prove that the "subject" outlives `ur`. - // If so, we don't have to propagate this requirement to our caller. - // - // To continue the example from the function, if we are trying to promote - // a requirement that `T: 'X`, and we know that `'X = '1 + '2` (i.e., the union - // `'1` and `'2`), then in this loop `ur` will be `'1` (and `'2`). So here - // we check whether `T: '1` is something we *can* prove. If so, no need - // to propagate that requirement. - // - // This is needed because -- particularly in the case - // where `ur` is a local bound -- we are sometimes in a - // position to prove things that our caller cannot. See - // #53570 for an example. - if self.eval_verify_bound(infcx, generic_ty, ur, &verify_bound) { - continue; - } - let non_local_ub = self.universal_region_relations.non_local_upper_bounds(ur); debug!(?non_local_ub); |
