Skip to content

Commit bb2bfb4

Browse files
committed
update for upstream rename: CodeExtent -> Scope
1 parent 3243843 commit bb2bfb4

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/librustc_mir/interpret/eval_context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::fmt::Write;
44
use rustc::hir::def_id::DefId;
55
use rustc::hir::map::definitions::DefPathData;
66
use rustc::middle::const_val::ConstVal;
7-
use rustc::middle::region::CodeExtent;
7+
use rustc::middle::region;
88
use rustc::mir;
99
use rustc::traits::Reveal;
1010
use rustc::ty::layout::{self, Layout, Size, Align, HasDataLayout};
@@ -106,7 +106,7 @@ pub enum StackPopCleanup {
106106
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
107107
pub struct DynamicLifetime {
108108
pub frame: usize,
109-
pub region: Option<CodeExtent>, // "None" indicates "until the function ends"
109+
pub region: Option<region::Scope>, // "None" indicates "until the function ends"
110110
}
111111

112112
#[derive(Copy, Clone, Debug)]

src/librustc_mir/interpret/memory.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::cell::Cell;
66
use rustc::ty::Instance;
77
use rustc::ty::layout::{self, TargetDataLayout, HasDataLayout};
88
use syntax::ast::Mutability;
9-
use rustc::middle::region::CodeExtent;
9+
use rustc::middle::region;
1010

1111
use super::{EvalResult, EvalErrorKind, PrimVal, Pointer, EvalContext, DynamicLifetime, Machine,
1212
RangeMap};
@@ -26,7 +26,7 @@ pub enum AccessKind {
2626
struct LockInfo {
2727
/// Stores for which lifetimes (of the original write lock) we got
2828
/// which suspensions.
29-
suspended: HashMap<DynamicLifetime, Vec<CodeExtent>>,
29+
suspended: HashMap<DynamicLifetime, Vec<region::Scope>>,
3030
/// The current state of the lock that's actually effective.
3131
active: Lock,
3232
}
@@ -567,7 +567,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> Memory<'a, 'tcx, M> {
567567
&mut self,
568568
ptr: MemoryPointer,
569569
len: u64,
570-
region: Option<CodeExtent>,
570+
region: Option<region::Scope>,
571571
kind: AccessKind,
572572
) -> EvalResult<'tcx> {
573573
let frame = self.cur_frame;
@@ -620,8 +620,8 @@ impl<'a, 'tcx, M: Machine<'tcx>> Memory<'a, 'tcx, M> {
620620
&mut self,
621621
ptr: MemoryPointer,
622622
len: u64,
623-
lock_region: Option<CodeExtent>,
624-
suspend: Option<CodeExtent>,
623+
lock_region: Option<region::Scope>,
624+
suspend: Option<region::Scope>,
625625
) -> EvalResult<'tcx> {
626626
assert!(len > 0);
627627
let cur_frame = self.cur_frame;
@@ -680,8 +680,8 @@ impl<'a, 'tcx, M: Machine<'tcx>> Memory<'a, 'tcx, M> {
680680
&mut self,
681681
ptr: MemoryPointer,
682682
len: u64,
683-
lock_region: Option<CodeExtent>,
684-
suspended_region: CodeExtent,
683+
lock_region: Option<region::Scope>,
684+
suspended_region: region::Scope,
685685
) -> EvalResult<'tcx> {
686686
assert!(len > 0);
687687
let cur_frame = self.cur_frame;
@@ -741,7 +741,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> Memory<'a, 'tcx, M> {
741741
Ok(())
742742
}
743743

744-
pub(crate) fn locks_lifetime_ended(&mut self, ending_region: Option<CodeExtent>) {
744+
pub(crate) fn locks_lifetime_ended(&mut self, ending_region: Option<region::Scope>) {
745745
let cur_frame = self.cur_frame;
746746
trace!(
747747
"Releasing frame {} locks that expire at {:?}",

src/librustc_mir/interpret/validation.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustc::ty::subst::{Substs, Subst};
66
use rustc::traits;
77
use rustc::infer::InferCtxt;
88
use rustc::traits::Reveal;
9-
use rustc::middle::region::CodeExtent;
9+
use rustc::middle::region;
1010

1111
use super::{EvalError, EvalResult, EvalErrorKind, EvalContext, DynamicLifetime, AccessKind, Value,
1212
Lvalue, LvalueExtra, Machine};
@@ -17,8 +17,8 @@ pub type ValidationQuery<'tcx> = ValidationOperand<'tcx, Lvalue>;
1717
enum ValidationMode {
1818
Acquire,
1919
/// Recover because the given region ended
20-
Recover(CodeExtent),
21-
ReleaseUntil(Option<CodeExtent>),
20+
Recover(region::Scope),
21+
ReleaseUntil(Option<region::Scope>),
2222
}
2323

2424
impl ValidationMode {
@@ -106,7 +106,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> {
106106
self.validate(query, mode)
107107
}
108108

109-
pub(crate) fn end_region(&mut self, ce: CodeExtent) -> EvalResult<'tcx> {
109+
pub(crate) fn end_region(&mut self, ce: region::Scope) -> EvalResult<'tcx> {
110110
self.memory.locks_lifetime_ended(Some(ce));
111111
// Recover suspended lvals
112112
let lft = DynamicLifetime {
@@ -268,7 +268,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> {
268268
&mut self,
269269
val: Value,
270270
pointee_ty: Ty<'tcx>,
271-
re: Option<CodeExtent>,
271+
re: Option<region::Scope>,
272272
mutbl: Mutability,
273273
mode: ValidationMode,
274274
) -> EvalResult<'tcx> {

0 commit comments

Comments
 (0)