diff options
| author | Yotam Ofek <yotam.ofek@gmail.com> | 2025-04-14 15:52:25 +0000 |
|---|---|---|
| committer | Yotam Ofek <yotam.ofek@gmail.com> | 2025-04-14 16:17:06 +0000 |
| commit | 4b63362f3d0a455707f64ce345ca3a5467b04764 (patch) | |
| tree | cb043c193a5dd7a45b176748fc069274f5806cf2 /compiler/rustc_borrowck | |
| parent | c580c498a1fe144d7c5b2dfc7faab1a229aa288b (diff) | |
| download | rust-4b63362f3d0a455707f64ce345ca3a5467b04764.tar.gz rust-4b63362f3d0a455707f64ce345ca3a5467b04764.zip | |
Use `newtype_index!`-generated types more idiomatically
Diffstat (limited to 'compiler/rustc_borrowck')
| -rw-r--r-- | compiler/rustc_borrowck/src/region_infer/mod.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_borrowck/src/region_infer/mod.rs b/compiler/rustc_borrowck/src/region_infer/mod.rs index c82c7341f02..f8af9e59f63 100644 --- a/compiler/rustc_borrowck/src/region_infer/mod.rs +++ b/compiler/rustc_borrowck/src/region_infer/mod.rs @@ -338,8 +338,7 @@ fn sccs_info<'tcx>(infcx: &BorrowckInferCtxt<'tcx>, sccs: &ConstraintSccs) { let num_components = sccs.num_sccs(); let mut components = vec![FxIndexSet::default(); num_components]; - for (reg_var_idx, scc_idx) in sccs.scc_indices().iter().enumerate() { - let reg_var = ty::RegionVid::from_usize(reg_var_idx); + for (reg_var, scc_idx) in sccs.scc_indices().iter_enumerated() { let origin = var_to_origin.get(®_var).unwrap_or(&RegionCtxt::Unknown); components[scc_idx.as_usize()].insert((reg_var, *origin)); } |
