about summary refs log tree commit diff
path: root/compiler/rustc_passes
diff options
context:
space:
mode:
authorYotam Ofek <yotam.ofek@gmail.com>2025-04-14 15:52:25 +0000
committerYotam Ofek <yotam.ofek@gmail.com>2025-04-14 16:17:06 +0000
commit4b63362f3d0a455707f64ce345ca3a5467b04764 (patch)
treecb043c193a5dd7a45b176748fc069274f5806cf2 /compiler/rustc_passes
parentc580c498a1fe144d7c5b2dfc7faab1a229aa288b (diff)
downloadrust-4b63362f3d0a455707f64ce345ca3a5467b04764.tar.gz
rust-4b63362f3d0a455707f64ce345ca3a5467b04764.zip
Use `newtype_index!`-generated types more idiomatically
Diffstat (limited to 'compiler/rustc_passes')
-rw-r--r--compiler/rustc_passes/src/liveness.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_passes/src/liveness.rs b/compiler/rustc_passes/src/liveness.rs
index 06eb76c30c5..7054bbf468b 100644
--- a/compiler/rustc_passes/src/liveness.rs
+++ b/compiler/rustc_passes/src/liveness.rs
@@ -578,8 +578,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
     where
         F: FnMut(Variable) -> bool,
     {
-        for var_idx in 0..self.ir.var_kinds.len() {
-            let var = Variable::from(var_idx);
+        for var in self.ir.var_kinds.indices() {
             if test(var) {
                 write!(wr, " {var:?}")?;
             }
@@ -609,8 +608,8 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
         debug!(
             "^^ liveness computation results for body {} (entry={:?})",
             {
-                for ln_idx in 0..self.ir.lnks.len() {
-                    debug!("{:?}", self.ln_str(LiveNode::from(ln_idx)));
+                for ln_idx in self.ir.lnks.indices() {
+                    debug!("{:?}", self.ln_str(ln_idx));
                 }
                 hir_id
             },