Declare body_owner
as LocalDefId
in MemCategorizationContext
This commit is contained in:
parent
3c6e6ca729
commit
91d5ab3fb1
@ -774,7 +774,7 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
|
|||||||
f(mc::MemCategorizationContext::new(
|
f(mc::MemCategorizationContext::new(
|
||||||
&self.infcx,
|
&self.infcx,
|
||||||
self.outlives_environment.param_env,
|
self.outlives_environment.param_env,
|
||||||
self.body_owner,
|
self.body_owner.expect_local(),
|
||||||
&self.tables.borrow(),
|
&self.tables.borrow(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
@ -146,8 +146,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let body_owner_def_id = self.tcx.hir().body_owner_def_id(body.id()).to_def_id();
|
let body_owner_def_id = self.tcx.hir().body_owner_def_id(body.id());
|
||||||
assert_eq!(body_owner_def_id, closure_def_id);
|
assert_eq!(body_owner_def_id.to_def_id(), closure_def_id);
|
||||||
let mut delegate = InferBorrowKind {
|
let mut delegate = InferBorrowKind {
|
||||||
fcx: self,
|
fcx: self,
|
||||||
closure_def_id,
|
closure_def_id,
|
||||||
|
@ -9,7 +9,7 @@ pub use mc::{Place, PlaceBase, Projection};
|
|||||||
|
|
||||||
use rustc_hir as hir;
|
use rustc_hir as hir;
|
||||||
use rustc_hir::def::Res;
|
use rustc_hir::def::Res;
|
||||||
use rustc_hir::def_id::DefId;
|
use rustc_hir::def_id::LocalDefId;
|
||||||
use rustc_hir::PatKind;
|
use rustc_hir::PatKind;
|
||||||
use rustc_infer::infer::InferCtxt;
|
use rustc_infer::infer::InferCtxt;
|
||||||
use rustc_middle::ty::{self, adjustment, TyCtxt};
|
use rustc_middle::ty::{self, adjustment, TyCtxt};
|
||||||
@ -84,7 +84,7 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
|
|||||||
pub fn new(
|
pub fn new(
|
||||||
delegate: &'a mut (dyn Delegate<'tcx> + 'a),
|
delegate: &'a mut (dyn Delegate<'tcx> + 'a),
|
||||||
infcx: &'a InferCtxt<'a, 'tcx>,
|
infcx: &'a InferCtxt<'a, 'tcx>,
|
||||||
body_owner: DefId,
|
body_owner: LocalDefId,
|
||||||
param_env: ty::ParamEnv<'tcx>,
|
param_env: ty::ParamEnv<'tcx>,
|
||||||
tables: &'a ty::TypeckTables<'tcx>,
|
tables: &'a ty::TypeckTables<'tcx>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
|
@ -55,7 +55,7 @@ use rustc_middle::ty::{self, Ty, TyCtxt};
|
|||||||
use rustc_data_structures::fx::FxIndexMap;
|
use rustc_data_structures::fx::FxIndexMap;
|
||||||
use rustc_hir as hir;
|
use rustc_hir as hir;
|
||||||
use rustc_hir::def::{DefKind, Res};
|
use rustc_hir::def::{DefKind, Res};
|
||||||
use rustc_hir::def_id::DefId;
|
use rustc_hir::def_id::LocalDefId;
|
||||||
use rustc_hir::PatKind;
|
use rustc_hir::PatKind;
|
||||||
use rustc_infer::infer::InferCtxt;
|
use rustc_infer::infer::InferCtxt;
|
||||||
use rustc_span::Span;
|
use rustc_span::Span;
|
||||||
@ -140,7 +140,7 @@ crate struct MemCategorizationContext<'a, 'tcx> {
|
|||||||
crate tables: &'a ty::TypeckTables<'tcx>,
|
crate tables: &'a ty::TypeckTables<'tcx>,
|
||||||
infcx: &'a InferCtxt<'a, 'tcx>,
|
infcx: &'a InferCtxt<'a, 'tcx>,
|
||||||
param_env: ty::ParamEnv<'tcx>,
|
param_env: ty::ParamEnv<'tcx>,
|
||||||
body_owner: DefId,
|
body_owner: LocalDefId,
|
||||||
upvars: Option<&'tcx FxIndexMap<hir::HirId, hir::Upvar>>,
|
upvars: Option<&'tcx FxIndexMap<hir::HirId, hir::Upvar>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ impl<'a, 'tcx> MemCategorizationContext<'a, 'tcx> {
|
|||||||
crate fn new(
|
crate fn new(
|
||||||
infcx: &'a InferCtxt<'a, 'tcx>,
|
infcx: &'a InferCtxt<'a, 'tcx>,
|
||||||
param_env: ty::ParamEnv<'tcx>,
|
param_env: ty::ParamEnv<'tcx>,
|
||||||
body_owner: DefId,
|
body_owner: LocalDefId,
|
||||||
tables: &'a ty::TypeckTables<'tcx>,
|
tables: &'a ty::TypeckTables<'tcx>,
|
||||||
) -> MemCategorizationContext<'a, 'tcx> {
|
) -> MemCategorizationContext<'a, 'tcx> {
|
||||||
MemCategorizationContext {
|
MemCategorizationContext {
|
||||||
@ -473,7 +473,7 @@ impl<'a, 'tcx> MemCategorizationContext<'a, 'tcx> {
|
|||||||
|
|
||||||
let upvar_id = ty::UpvarId {
|
let upvar_id = ty::UpvarId {
|
||||||
var_path: ty::UpvarPath { hir_id: var_id },
|
var_path: ty::UpvarPath { hir_id: var_id },
|
||||||
closure_expr_id: closure_expr_def_id.expect_local(),
|
closure_expr_id: closure_expr_def_id,
|
||||||
};
|
};
|
||||||
let var_ty = self.node_ty(var_id)?;
|
let var_ty = self.node_ty(var_id)?;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user