diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-08-20 00:28:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-20 00:28:33 +0200 |
| commit | a12d58c2ca569ea27b8f3733f7eff614b48d7b90 (patch) | |
| tree | 507bae6addf97e7e481831277f60c74cbf97f17e | |
| parent | d761a5fe1128820549ed7a496107aa74d863bc02 (diff) | |
| parent | 269803ee56146c1739ec8f7169ad8fe0f90fb30c (diff) | |
| download | rust-a12d58c2ca569ea27b8f3733f7eff614b48d7b90.tar.gz rust-a12d58c2ca569ea27b8f3733f7eff614b48d7b90.zip | |
Rollup merge of #114991 - matthiaskrgr:no_rebind, r=cjgillot
remove redundant var rebindings
| -rw-r--r-- | compiler/rustc_middle/src/hir/mod.rs | 7 | ||||
| -rw-r--r-- | compiler/rustc_passes/src/layout_test.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_passes/src/liveness.rs | 1 |
3 files changed, 2 insertions, 7 deletions
diff --git a/compiler/rustc_middle/src/hir/mod.rs b/compiler/rustc_middle/src/hir/mod.rs index e8fd469e1fb..0da8fe9cca7 100644 --- a/compiler/rustc_middle/src/hir/mod.rs +++ b/compiler/rustc_middle/src/hir/mod.rs @@ -164,18 +164,15 @@ pub fn provide(providers: &mut Providers) { tcx.hir_crate(()).owners[id.def_id].as_owner().map_or(AttributeMap::EMPTY, |o| &o.attrs) }; providers.def_span = |tcx, def_id| { - let def_id = def_id; let hir_id = tcx.hir().local_def_id_to_hir_id(def_id); tcx.hir().opt_span(hir_id).unwrap_or(DUMMY_SP) }; providers.def_ident_span = |tcx, def_id| { - let def_id = def_id; let hir_id = tcx.hir().local_def_id_to_hir_id(def_id); tcx.hir().opt_ident_span(hir_id) }; - providers.fn_arg_names = |tcx, id| { + providers.fn_arg_names = |tcx, def_id| { let hir = tcx.hir(); - let def_id = id; let hir_id = hir.local_def_id_to_hir_id(def_id); if let Some(body_id) = hir.maybe_body_owned_by(def_id) { tcx.arena.alloc_from_iter(hir.body_param_names(body_id)) @@ -190,7 +187,7 @@ pub fn provide(providers: &mut Providers) { { idents } else { - span_bug!(hir.span(hir_id), "fn_arg_names: unexpected item {:?}", id); + span_bug!(hir.span(hir_id), "fn_arg_names: unexpected item {:?}", def_id); } }; providers.opt_def_kind = |tcx, def_id| tcx.hir().opt_def_kind(def_id); diff --git a/compiler/rustc_passes/src/layout_test.rs b/compiler/rustc_passes/src/layout_test.rs index 0463ee2914b..a7a8af864ac 100644 --- a/compiler/rustc_passes/src/layout_test.rs +++ b/compiler/rustc_passes/src/layout_test.rs @@ -27,7 +27,6 @@ pub fn test_layout(tcx: TyCtxt<'_>) { } fn dump_layout_of(tcx: TyCtxt<'_>, item_def_id: LocalDefId, attr: &Attribute) { - let tcx = tcx; let param_env = tcx.param_env(item_def_id); let ty = tcx.type_of(item_def_id).instantiate_identity(); match tcx.layout_of(param_env.and(ty)) { diff --git a/compiler/rustc_passes/src/liveness.rs b/compiler/rustc_passes/src/liveness.rs index 0c0b8b6d094..20e996eaec4 100644 --- a/compiler/rustc_passes/src/liveness.rs +++ b/compiler/rustc_passes/src/liveness.rs @@ -1105,7 +1105,6 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> { } // Then do a second pass for inputs - let mut succ = succ; for (op, _op_sp) in asm.operands.iter().rev() { match op { hir::InlineAsmOperand::In { expr, .. } => { |
