提交 37db94d3 编写于 作者: N Niko Matsakis

store the `HirId` of the upvar

上级 f03c0366
......@@ -30,7 +30,7 @@
internal,
is_user_variable
});
impl_stable_hash_for!(struct mir::UpvarDecl { debug_name, by_ref, mutability });
impl_stable_hash_for!(struct mir::UpvarDecl { debug_name, var_hir_id, by_ref, mutability });
impl_stable_hash_for!(struct mir::BasicBlockData<'tcx> { statements, terminator, is_cleanup });
impl_stable_hash_for!(struct mir::UnsafetyViolation { source_info, description, kind });
impl_stable_hash_for!(struct mir::UnsafetyCheckResult { violations, unsafe_blocks });
......
......@@ -15,7 +15,7 @@
use graphviz::IntoCow;
use hir::def::CtorKind;
use hir::def_id::DefId;
use hir::{self, InlineAsm};
use hir::{self, HirId, InlineAsm};
use middle::region;
use mir::interpret::{EvalErrorKind, Scalar, Value};
use mir::visit::MirVisitable;
......@@ -785,6 +785,9 @@ pub fn new_return_place(return_ty: Ty, span: Span) -> LocalDecl {
pub struct UpvarDecl {
pub debug_name: Name,
/// `HirId` of the captured variable
pub var_hir_id: ClearCrossCrate<HirId>,
/// If true, the capture is behind a reference.
pub by_ref: bool,
......
......@@ -534,6 +534,7 @@ fn construct_fn<'a, 'gcx, 'tcx, A>(hir: Cx<'a, 'gcx, 'tcx>,
};
let mut decl = UpvarDecl {
debug_name: keywords::Invalid.name(),
var_hir_id: ClearCrossCrate::Set(var_hir_id),
by_ref,
mutability: Mutability::Not,
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册