Skip to content

Commit 615c23f

Browse files
committed
Remove unused parameter from in(_opt)?_scope
1 parent 50a0def commit 615c23f

File tree

9 files changed

+18
-18
lines changed

9 files changed

+18
-18
lines changed

src/librustc_mir/build/block.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
2323
safety_mode
2424
} =
2525
self.hir.mirror(ast_block);
26-
self.in_opt_scope(opt_destruction_scope.map(|de|(de, source_info)), block, move |this| {
27-
this.in_scope((region_scope, source_info), LintLevel::Inherited, block, move |this| {
26+
self.in_opt_scope(opt_destruction_scope.map(|de|(de, source_info)), move |this| {
27+
this.in_scope((region_scope, source_info), LintLevel::Inherited, move |this| {
2828
if targeted_by_break {
2929
// This is a `break`-able block
3030
let exit_block = this.cfg.start_new_block();
@@ -83,9 +83,9 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
8383
StmtKind::Expr { scope, expr } => {
8484
this.block_context.push(BlockFrame::Statement { ignores_expr_result: true });
8585
unpack!(block = this.in_opt_scope(
86-
opt_destruction_scope.map(|de|(de, source_info)), block, |this| {
86+
opt_destruction_scope.map(|de|(de, source_info)), |this| {
8787
let si = (scope, source_info);
88-
this.in_scope(si, LintLevel::Inherited, block, |this| {
88+
this.in_scope(si, LintLevel::Inherited, |this| {
8989
let expr = this.hir.mirror(expr);
9090
this.stmt_expr(block, expr, Some(stmt_span))
9191
})
@@ -128,9 +128,9 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
128128
Some((None, initializer_span)),
129129
);
130130
unpack!(block = this.in_opt_scope(
131-
opt_destruction_scope.map(|de|(de, source_info)), block, |this| {
131+
opt_destruction_scope.map(|de|(de, source_info)), |this| {
132132
let scope = (init_scope, source_info);
133-
this.in_scope(scope, lint_level, block, |this| {
133+
this.in_scope(scope, lint_level, |this| {
134134
this.expr_into_pattern(block, pattern, init)
135135
})
136136
}));

src/librustc_mir/build/expr/as_operand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
5757
{
5858
let source_info = this.source_info(expr.span);
5959
let region_scope = (region_scope, source_info);
60-
return this.in_scope(region_scope, lint_level, block, |this| {
60+
return this.in_scope(region_scope, lint_level, |this| {
6161
this.as_operand(block, scope, value)
6262
});
6363
}

src/librustc_mir/build/expr/as_place.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
5252
region_scope,
5353
lint_level,
5454
value,
55-
} => this.in_scope((region_scope, source_info), lint_level, block, |this| {
55+
} => this.in_scope((region_scope, source_info), lint_level, |this| {
5656
if mutability == Mutability::Not {
5757
this.as_read_only_place(block, value)
5858
} else {

src/librustc_mir/build/expr/as_rvalue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
5858
value,
5959
} => {
6060
let region_scope = (region_scope, source_info);
61-
this.in_scope(region_scope, lint_level, block, |this| {
61+
this.in_scope(region_scope, lint_level, |this| {
6262
this.as_rvalue(block, scope, value)
6363
})
6464
}

src/librustc_mir/build/expr/as_temp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
4343
value,
4444
} = expr.kind
4545
{
46-
return this.in_scope((region_scope, source_info), lint_level, block, |this| {
46+
return this.in_scope((region_scope, source_info), lint_level, |this| {
4747
this.as_temp(block, temp_lifetime, value, mutability)
4848
});
4949
}

src/librustc_mir/build/expr/into.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
4646
value,
4747
} => {
4848
let region_scope = (region_scope, source_info);
49-
this.in_scope(region_scope, lint_level, block, |this| {
49+
this.in_scope(region_scope, lint_level, |this| {
5050
this.into(destination, block, value)
5151
})
5252
}

src/librustc_mir/build/expr/stmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
2929
value,
3030
} => {
3131
let value = this.hir.mirror(value);
32-
this.in_scope((region_scope, source_info), lint_level, block, |this| {
32+
this.in_scope((region_scope, source_info), lint_level, |this| {
3333
this.stmt_expr(block, value, opt_stmt_span)
3434
})
3535
}

src/librustc_mir/build/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,13 +702,13 @@ fn construct_fn<'a, 'gcx, 'tcx, A>(hir: Cx<'a, 'gcx, 'tcx>,
702702
let mut block = START_BLOCK;
703703
let source_info = builder.source_info(span);
704704
let call_site_s = (call_site_scope, source_info);
705-
unpack!(block = builder.in_scope(call_site_s, LintLevel::Inherited, block, |builder| {
705+
unpack!(block = builder.in_scope(call_site_s, LintLevel::Inherited, |builder| {
706706
if should_abort_on_panic(tcx, fn_def_id, abi) {
707707
builder.schedule_abort();
708708
}
709709

710710
let arg_scope_s = (arg_scope, source_info);
711-
unpack!(block = builder.in_scope(arg_scope_s, LintLevel::Inherited, block, |builder| {
711+
unpack!(block = builder.in_scope(arg_scope_s, LintLevel::Inherited, |builder| {
712712
builder.args_and_body(block, &arguments, arg_scope, &body.value)
713713
}));
714714
// Attribute epilogue to function's closing brace

src/librustc_mir/build/scope.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,13 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
279279

280280
pub fn in_opt_scope<F, R>(&mut self,
281281
opt_scope: Option<(region::Scope, SourceInfo)>,
282-
mut block: BasicBlock,
283282
f: F)
284283
-> BlockAnd<R>
285284
where F: FnOnce(&mut Builder<'a, 'gcx, 'tcx>) -> BlockAnd<R>
286285
{
287-
debug!("in_opt_scope(opt_scope={:?}, block={:?})", opt_scope, block);
286+
debug!("in_opt_scope(opt_scope={:?})", opt_scope);
288287
if let Some(region_scope) = opt_scope { self.push_scope(region_scope); }
288+
let mut block;
289289
let rv = unpack!(block = f(self));
290290
if let Some(region_scope) = opt_scope {
291291
unpack!(block = self.pop_scope(region_scope, block));
@@ -299,12 +299,11 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
299299
pub fn in_scope<F, R>(&mut self,
300300
region_scope: (region::Scope, SourceInfo),
301301
lint_level: LintLevel,
302-
mut block: BasicBlock,
303302
f: F)
304303
-> BlockAnd<R>
305304
where F: FnOnce(&mut Builder<'a, 'gcx, 'tcx>) -> BlockAnd<R>
306305
{
307-
debug!("in_scope(region_scope={:?}, block={:?})", region_scope, block);
306+
debug!("in_scope(region_scope={:?})", region_scope);
308307
let source_scope = self.source_scope;
309308
let tcx = self.hir.tcx();
310309
if let LintLevel::Explicit(current_hir_id) = lint_level {
@@ -330,6 +329,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
330329
}
331330
}
332331
self.push_scope(region_scope);
332+
let mut block;
333333
let rv = unpack!(block = f(self));
334334
unpack!(block = self.pop_scope(region_scope, block));
335335
self.source_scope = source_scope;

0 commit comments

Comments
 (0)