safety_mode
} =
self.hir.mirror(ast_block);
- self.in_opt_scope(opt_destruction_scope.map(|de|(de, source_info)), block, move |this| {
- this.in_scope((region_scope, source_info), LintLevel::Inherited, block, move |this| {
+ self.in_opt_scope(opt_destruction_scope.map(|de|(de, source_info)), move |this| {
+ this.in_scope((region_scope, source_info), LintLevel::Inherited, move |this| {
if targeted_by_break {
// This is a `break`-able block
let exit_block = this.cfg.start_new_block();
StmtKind::Expr { scope, expr } => {
this.block_context.push(BlockFrame::Statement { ignores_expr_result: true });
unpack!(block = this.in_opt_scope(
- opt_destruction_scope.map(|de|(de, source_info)), block, |this| {
+ opt_destruction_scope.map(|de|(de, source_info)), |this| {
let si = (scope, source_info);
- this.in_scope(si, LintLevel::Inherited, block, |this| {
+ this.in_scope(si, LintLevel::Inherited, |this| {
let expr = this.hir.mirror(expr);
this.stmt_expr(block, expr, Some(stmt_span))
})
Some((None, initializer_span)),
);
unpack!(block = this.in_opt_scope(
- opt_destruction_scope.map(|de|(de, source_info)), block, |this| {
+ opt_destruction_scope.map(|de|(de, source_info)), |this| {
let scope = (init_scope, source_info);
- this.in_scope(scope, lint_level, block, |this| {
+ this.in_scope(scope, lint_level, |this| {
this.expr_into_pattern(block, pattern, init)
})
}));
{
let source_info = this.source_info(expr.span);
let region_scope = (region_scope, source_info);
- return this.in_scope(region_scope, lint_level, block, |this| {
+ return this.in_scope(region_scope, lint_level, |this| {
this.as_operand(block, scope, value)
});
}
region_scope,
lint_level,
value,
- } => this.in_scope((region_scope, source_info), lint_level, block, |this| {
+ } => this.in_scope((region_scope, source_info), lint_level, |this| {
if mutability == Mutability::Not {
this.as_read_only_place(block, value)
} else {
value,
} => {
let region_scope = (region_scope, source_info);
- this.in_scope(region_scope, lint_level, block, |this| {
+ this.in_scope(region_scope, lint_level, |this| {
this.as_rvalue(block, scope, value)
})
}
value,
} = expr.kind
{
- return this.in_scope((region_scope, source_info), lint_level, block, |this| {
+ return this.in_scope((region_scope, source_info), lint_level, |this| {
this.as_temp(block, temp_lifetime, value, mutability)
});
}
value,
} => {
let region_scope = (region_scope, source_info);
- this.in_scope(region_scope, lint_level, block, |this| {
+ this.in_scope(region_scope, lint_level, |this| {
this.into(destination, block, value)
})
}
value,
} => {
let value = this.hir.mirror(value);
- this.in_scope((region_scope, source_info), lint_level, block, |this| {
+ this.in_scope((region_scope, source_info), lint_level, |this| {
this.stmt_expr(block, value, opt_stmt_span)
})
}
let mut block = START_BLOCK;
let source_info = builder.source_info(span);
let call_site_s = (call_site_scope, source_info);
- unpack!(block = builder.in_scope(call_site_s, LintLevel::Inherited, block, |builder| {
+ unpack!(block = builder.in_scope(call_site_s, LintLevel::Inherited, |builder| {
if should_abort_on_panic(tcx, fn_def_id, abi) {
builder.schedule_abort();
}
let arg_scope_s = (arg_scope, source_info);
- unpack!(block = builder.in_scope(arg_scope_s, LintLevel::Inherited, block, |builder| {
+ unpack!(block = builder.in_scope(arg_scope_s, LintLevel::Inherited, |builder| {
builder.args_and_body(block, &arguments, arg_scope, &body.value)
}));
// Attribute epilogue to function's closing brace
pub fn in_opt_scope<F, R>(&mut self,
opt_scope: Option<(region::Scope, SourceInfo)>,
- mut block: BasicBlock,
f: F)
-> BlockAnd<R>
where F: FnOnce(&mut Builder<'a, 'gcx, 'tcx>) -> BlockAnd<R>
{
- debug!("in_opt_scope(opt_scope={:?}, block={:?})", opt_scope, block);
+ debug!("in_opt_scope(opt_scope={:?})", opt_scope);
if let Some(region_scope) = opt_scope { self.push_scope(region_scope); }
+ let mut block;
let rv = unpack!(block = f(self));
if let Some(region_scope) = opt_scope {
unpack!(block = self.pop_scope(region_scope, block));
pub fn in_scope<F, R>(&mut self,
region_scope: (region::Scope, SourceInfo),
lint_level: LintLevel,
- mut block: BasicBlock,
f: F)
-> BlockAnd<R>
where F: FnOnce(&mut Builder<'a, 'gcx, 'tcx>) -> BlockAnd<R>
{
- debug!("in_scope(region_scope={:?}, block={:?})", region_scope, block);
+ debug!("in_scope(region_scope={:?})", region_scope);
let source_scope = self.source_scope;
let tcx = self.hir.tcx();
if let LintLevel::Explicit(current_hir_id) = lint_level {
}
}
self.push_scope(region_scope);
+ let mut block;
let rv = unpack!(block = f(self));
unpack!(block = self.pop_scope(region_scope, block));
self.source_scope = source_scope;