Skip to content

Commit 3b6852a

Browse files
authored
Merge branch 'master' into align_offset
2 parents cf25ef9 + 9386f05 commit 3b6852a

14 files changed

+68
-65
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ script:
1616
xargo/build.sh
1717
- |
1818
# Test plain miri
19-
cargo build --release --features "cargo_miri" &&
19+
cargo build --locked --release --features "cargo_miri" &&
2020
cargo test --release --all &&
2121
cargo install --features "cargo_miri"
2222
- |
@@ -31,7 +31,7 @@ script:
3131
- |
3232
# test that the rustc_tests binary compiles
3333
cd rustc_tests &&
34-
cargo build --release &&
34+
cargo build --locked --release &&
3535
cd ..
3636
notifications:
3737
email:

Cargo.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,15 @@ build = "build.rs"
1010
[[bin]]
1111
doc = false
1212
name = "miri"
13-
test = false
1413
path = "miri/bin/miri.rs"
1514

1615
[[bin]]
1716
doc = false
1817
name = "cargo-miri"
19-
test = false
2018
path = "miri/bin/cargo-miri.rs"
2119
required-features = ["cargo_miri"]
2220

2321
[lib]
24-
test = false
2522
path = "miri/lib.rs"
2623

2724
[dependencies]
@@ -36,8 +33,7 @@ rustc_miri = { path = "src/librustc_mir" }
3633
cargo_miri = ["cargo_metadata"]
3734

3835
[dev-dependencies]
39-
compiletest_rs = "0.2.6"
40-
tempdir = "0.3"
36+
compiletest_rs = { version = "0.2.10", features = ["tmp"] }
4137

4238
[workspace]
4339
exclude = ["xargo", "cargo-miri-test", "rustc_tests"]

rustc_tests/Cargo.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/librustc_mir/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ log = "0.3.6"
1616
log_settings = "0.1.1"
1717
lazy_static = "0.2.8"
1818
regex = "0.2.2"
19-
backtrace = { version = "0.3", git = "https://github.com/alexcrichton/backtrace-rs" }
19+
backtrace = "0.3.3"

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: 13 additions & 13 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 {
@@ -89,34 +89,34 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> {
8989
let mode = match op {
9090
ValidationOp::Acquire => ValidationMode::Acquire,
9191
ValidationOp::Release => ValidationMode::ReleaseUntil(None),
92-
ValidationOp::Suspend(ce) => {
92+
ValidationOp::Suspend(scope) => {
9393
if query.mutbl == MutMutable {
9494
let lft = DynamicLifetime {
9595
frame: self.cur_frame(),
96-
region: Some(ce),
96+
region: Some(scope),
9797
};
98-
trace!("Suspending {:?} until {:?}", query, ce);
98+
trace!("Suspending {:?} until {:?}", query, scope);
9999
self.suspended.entry(lft).or_insert_with(Vec::new).push(
100100
query.clone(),
101101
);
102102
}
103-
ValidationMode::ReleaseUntil(Some(ce))
103+
ValidationMode::ReleaseUntil(Some(scope))
104104
}
105105
};
106106
self.validate(query, mode)
107107
}
108108

109-
pub(crate) fn end_region(&mut self, ce: CodeExtent) -> EvalResult<'tcx> {
110-
self.memory.locks_lifetime_ended(Some(ce));
109+
pub(crate) fn end_region(&mut self, scope: region::Scope) -> EvalResult<'tcx> {
110+
self.memory.locks_lifetime_ended(Some(scope));
111111
// Recover suspended lvals
112112
let lft = DynamicLifetime {
113113
frame: self.cur_frame(),
114-
region: Some(ce),
114+
region: Some(scope),
115115
};
116116
if let Some(queries) = self.suspended.remove(&lft) {
117117
for query in queries {
118118
trace!("Recovering {:?} from suspension", query);
119-
self.validate(query, ValidationMode::Recover(ce))?;
119+
self.validate(query, ValidationMode::Recover(scope))?;
120120
}
121121
}
122122
Ok(())
@@ -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> {
@@ -459,7 +459,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> {
459459
// we record the region of this borrow to the context.
460460
if query.re == None {
461461
match *region {
462-
ReScope(ce) => query.re = Some(ce),
462+
ReScope(scope) => query.re = Some(scope),
463463
// It is possible for us to encounter erased lifetimes here because the lifetimes in
464464
// this functions' Subst will be erased.
465465
_ => {}

0 commit comments

Comments
 (0)