Skip to content

Commit 269803e

Browse files
committed
remove redundant var rebindings
1 parent d06ca0f commit 269803e

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

compiler/rustc_middle/src/hir/mod.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,15 @@ pub fn provide(providers: &mut Providers) {
164164
tcx.hir_crate(()).owners[id.def_id].as_owner().map_or(AttributeMap::EMPTY, |o| &o.attrs)
165165
};
166166
providers.def_span = |tcx, def_id| {
167-
let def_id = def_id;
168167
let hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
169168
tcx.hir().opt_span(hir_id).unwrap_or(DUMMY_SP)
170169
};
171170
providers.def_ident_span = |tcx, def_id| {
172-
let def_id = def_id;
173171
let hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
174172
tcx.hir().opt_ident_span(hir_id)
175173
};
176-
providers.fn_arg_names = |tcx, id| {
174+
providers.fn_arg_names = |tcx, def_id| {
177175
let hir = tcx.hir();
178-
let def_id = id;
179176
let hir_id = hir.local_def_id_to_hir_id(def_id);
180177
if let Some(body_id) = hir.maybe_body_owned_by(def_id) {
181178
tcx.arena.alloc_from_iter(hir.body_param_names(body_id))
@@ -190,7 +187,7 @@ pub fn provide(providers: &mut Providers) {
190187
{
191188
idents
192189
} else {
193-
span_bug!(hir.span(hir_id), "fn_arg_names: unexpected item {:?}", id);
190+
span_bug!(hir.span(hir_id), "fn_arg_names: unexpected item {:?}", def_id);
194191
}
195192
};
196193
providers.opt_def_kind = |tcx, def_id| tcx.hir().opt_def_kind(def_id);

compiler/rustc_passes/src/layout_test.rs

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ pub fn test_layout(tcx: TyCtxt<'_>) {
2727
}
2828

2929
fn dump_layout_of(tcx: TyCtxt<'_>, item_def_id: LocalDefId, attr: &Attribute) {
30-
let tcx = tcx;
3130
let param_env = tcx.param_env(item_def_id);
3231
let ty = tcx.type_of(item_def_id).instantiate_identity();
3332
match tcx.layout_of(param_env.and(ty)) {

compiler/rustc_passes/src/liveness.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,6 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
11051105
}
11061106

11071107
// Then do a second pass for inputs
1108-
let mut succ = succ;
11091108
for (op, _op_sp) in asm.operands.iter().rev() {
11101109
match op {
11111110
hir::InlineAsmOperand::In { expr, .. } => {

0 commit comments

Comments
 (0)