diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-09-11 17:06:44 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-09-17 16:24:35 +1000 |
| commit | 3ec2f121cc92879bdfc6aa80c29841b7e3a779e1 (patch) | |
| tree | dd089005b2ec4d29b843d7266aed7994d9a7932d /compiler | |
| parent | ae1f092307986627ac18887ebf169ce35ef3046e (diff) | |
| download | rust-3ec2f121cc92879bdfc6aa80c29841b7e3a779e1.tar.gz rust-3ec2f121cc92879bdfc6aa80c29841b7e3a779e1.zip | |
Rename some lifetimes.
`'mir` is not a good lifetime name in `LocalAnalyzer`, because it's used on two unrelated fields. `'a` is more standard for a situation like this (e.g. #130022).
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/analyze.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/analyze.rs b/compiler/rustc_codegen_ssa/src/mir/analyze.rs index 386e1f91e7f..f13c46e8bef 100644 --- a/compiler/rustc_codegen_ssa/src/mir/analyze.rs +++ b/compiler/rustc_codegen_ssa/src/mir/analyze.rs @@ -69,13 +69,13 @@ enum LocalKind { SSA(DefLocation), } -struct LocalAnalyzer<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> { - fx: &'mir FunctionCx<'a, 'tcx, Bx>, - dominators: &'mir Dominators<mir::BasicBlock>, +struct LocalAnalyzer<'a, 'b, 'tcx, Bx: BuilderMethods<'b, 'tcx>> { + fx: &'a FunctionCx<'b, 'tcx, Bx>, + dominators: &'a Dominators<mir::BasicBlock>, locals: IndexVec<mir::Local, LocalKind>, } -impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, Bx> { +impl<'a, 'b, 'tcx, Bx: BuilderMethods<'b, 'tcx>> LocalAnalyzer<'a, 'b, 'tcx, Bx> { fn define(&mut self, local: mir::Local, location: DefLocation) { let kind = &mut self.locals[local]; match *kind { @@ -152,9 +152,7 @@ impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, } } -impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx> - for LocalAnalyzer<'mir, 'a, 'tcx, Bx> -{ +impl<'a, 'b, 'tcx, Bx: BuilderMethods<'b, 'tcx>> Visitor<'tcx> for LocalAnalyzer<'a, 'b, 'tcx, Bx> { fn visit_assign( &mut self, place: &mir::Place<'tcx>, |
