update for upstream rename: CodeExtent -> Scope
This commit is contained in:
parent
3243843755
commit
bb2bfb4353
3 changed files with 15 additions and 15 deletions
|
|
@ -4,7 +4,7 @@ use std::fmt::Write;
|
|||
use rustc::hir::def_id::DefId;
|
||||
use rustc::hir::map::definitions::DefPathData;
|
||||
use rustc::middle::const_val::ConstVal;
|
||||
use rustc::middle::region::CodeExtent;
|
||||
use rustc::middle::region;
|
||||
use rustc::mir;
|
||||
use rustc::traits::Reveal;
|
||||
use rustc::ty::layout::{self, Layout, Size, Align, HasDataLayout};
|
||||
|
|
@ -106,7 +106,7 @@ pub enum StackPopCleanup {
|
|||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
||||
pub struct DynamicLifetime {
|
||||
pub frame: usize,
|
||||
pub region: Option<CodeExtent>, // "None" indicates "until the function ends"
|
||||
pub region: Option<region::Scope>, // "None" indicates "until the function ends"
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use std::cell::Cell;
|
|||
use rustc::ty::Instance;
|
||||
use rustc::ty::layout::{self, TargetDataLayout, HasDataLayout};
|
||||
use syntax::ast::Mutability;
|
||||
use rustc::middle::region::CodeExtent;
|
||||
use rustc::middle::region;
|
||||
|
||||
use super::{EvalResult, EvalErrorKind, PrimVal, Pointer, EvalContext, DynamicLifetime, Machine,
|
||||
RangeMap};
|
||||
|
|
@ -26,7 +26,7 @@ pub enum AccessKind {
|
|||
struct LockInfo {
|
||||
/// Stores for which lifetimes (of the original write lock) we got
|
||||
/// which suspensions.
|
||||
suspended: HashMap<DynamicLifetime, Vec<CodeExtent>>,
|
||||
suspended: HashMap<DynamicLifetime, Vec<region::Scope>>,
|
||||
/// The current state of the lock that's actually effective.
|
||||
active: Lock,
|
||||
}
|
||||
|
|
@ -567,7 +567,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> Memory<'a, 'tcx, M> {
|
|||
&mut self,
|
||||
ptr: MemoryPointer,
|
||||
len: u64,
|
||||
region: Option<CodeExtent>,
|
||||
region: Option<region::Scope>,
|
||||
kind: AccessKind,
|
||||
) -> EvalResult<'tcx> {
|
||||
let frame = self.cur_frame;
|
||||
|
|
@ -620,8 +620,8 @@ impl<'a, 'tcx, M: Machine<'tcx>> Memory<'a, 'tcx, M> {
|
|||
&mut self,
|
||||
ptr: MemoryPointer,
|
||||
len: u64,
|
||||
lock_region: Option<CodeExtent>,
|
||||
suspend: Option<CodeExtent>,
|
||||
lock_region: Option<region::Scope>,
|
||||
suspend: Option<region::Scope>,
|
||||
) -> EvalResult<'tcx> {
|
||||
assert!(len > 0);
|
||||
let cur_frame = self.cur_frame;
|
||||
|
|
@ -680,8 +680,8 @@ impl<'a, 'tcx, M: Machine<'tcx>> Memory<'a, 'tcx, M> {
|
|||
&mut self,
|
||||
ptr: MemoryPointer,
|
||||
len: u64,
|
||||
lock_region: Option<CodeExtent>,
|
||||
suspended_region: CodeExtent,
|
||||
lock_region: Option<region::Scope>,
|
||||
suspended_region: region::Scope,
|
||||
) -> EvalResult<'tcx> {
|
||||
assert!(len > 0);
|
||||
let cur_frame = self.cur_frame;
|
||||
|
|
@ -741,7 +741,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> Memory<'a, 'tcx, M> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) fn locks_lifetime_ended(&mut self, ending_region: Option<CodeExtent>) {
|
||||
pub(crate) fn locks_lifetime_ended(&mut self, ending_region: Option<region::Scope>) {
|
||||
let cur_frame = self.cur_frame;
|
||||
trace!(
|
||||
"Releasing frame {} locks that expire at {:?}",
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use rustc::ty::subst::{Substs, Subst};
|
|||
use rustc::traits;
|
||||
use rustc::infer::InferCtxt;
|
||||
use rustc::traits::Reveal;
|
||||
use rustc::middle::region::CodeExtent;
|
||||
use rustc::middle::region;
|
||||
|
||||
use super::{EvalError, EvalResult, EvalErrorKind, EvalContext, DynamicLifetime, AccessKind, Value,
|
||||
Lvalue, LvalueExtra, Machine};
|
||||
|
|
@ -17,8 +17,8 @@ pub type ValidationQuery<'tcx> = ValidationOperand<'tcx, Lvalue>;
|
|||
enum ValidationMode {
|
||||
Acquire,
|
||||
/// Recover because the given region ended
|
||||
Recover(CodeExtent),
|
||||
ReleaseUntil(Option<CodeExtent>),
|
||||
Recover(region::Scope),
|
||||
ReleaseUntil(Option<region::Scope>),
|
||||
}
|
||||
|
||||
impl ValidationMode {
|
||||
|
|
@ -106,7 +106,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> {
|
|||
self.validate(query, mode)
|
||||
}
|
||||
|
||||
pub(crate) fn end_region(&mut self, ce: CodeExtent) -> EvalResult<'tcx> {
|
||||
pub(crate) fn end_region(&mut self, ce: region::Scope) -> EvalResult<'tcx> {
|
||||
self.memory.locks_lifetime_ended(Some(ce));
|
||||
// Recover suspended lvals
|
||||
let lft = DynamicLifetime {
|
||||
|
|
@ -268,7 +268,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> {
|
|||
&mut self,
|
||||
val: Value,
|
||||
pointee_ty: Ty<'tcx>,
|
||||
re: Option<CodeExtent>,
|
||||
re: Option<region::Scope>,
|
||||
mutbl: Mutability,
|
||||
mode: ValidationMode,
|
||||
) -> EvalResult<'tcx> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue