/// `{ STMTS; EXPR1 } + EXPR2`.
block_context: BlockContext,
- /// The current unsafe block in scope, even if it is hidden by
- /// a `PushUnsafeBlock`.
- unpushed_unsafe: Safety,
-
- /// The number of `push_unsafe_block` levels in scope.
- push_unsafe_count: usize,
+ /// The current unsafe block in scope
+ in_scope_unsafe: Safety,
/// The vector of all scopes that we have created thus far;
/// we track this for debuginfo later.
source_scopes: IndexVec::new(),
source_scope: OUTERMOST_SOURCE_SCOPE,
guard_context: vec![],
- push_unsafe_count: 0,
- unpushed_unsafe: safety,
+ in_scope_unsafe: safety,
local_decls: IndexVec::from_elem_n(LocalDecl::new(return_ty, return_span), 1),
canonical_user_type_annotations: IndexVec::new(),
upvar_mutbls: vec![],
// the given closure and use the necessary information to create upvar
// debuginfo and to fill `self.upvar_mutbls`.
if hir_typeck_results.closure_min_captures.get(&fn_def_id).is_some() {
- let closure_env_arg = Local::new(1);
let mut closure_env_projs = vec![];
- let mut closure_ty = self.local_decls[closure_env_arg].ty;
+ let mut closure_ty = self.local_decls[ty::CAPTURE_STRUCT_LOCAL].ty;
if let ty::Ref(_, ty, _) = closure_ty.kind() {
closure_env_projs.push(ProjectionElem::Deref);
closure_ty = ty;
name,
source_info: SourceInfo::outermost(tcx_hir.span(var_id)),
value: VarDebugInfoContents::Place(Place {
- local: closure_env_arg,
+ local: ty::CAPTURE_STRUCT_LOCAL,
projection: tcx.intern_place_elems(&projs),
}),
});