Skip to content

Commit eab2538

Browse files
committed
Rename track-id to track-pointer-tag
1 parent 6741794 commit eab2538

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

benches/helpers/miri_helper.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls<'_> {
3232
excluded_env_vars: vec![],
3333
args: vec![],
3434
seed: None,
35-
tracked_id: None,
35+
tracked_pointer_tag: None,
3636
};
3737
eval_main(tcx, entry_def_id, config);
3838
});

src/bin/miri-rustc-tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
4545
excluded_env_vars: vec![],
4646
args: vec![],
4747
seed: None,
48-
tracked_id: None,
48+
tracked_pointer_tag: None,
4949
};
5050
let did = self.0.hir().body_owner_def_id(body_id);
5151
println!("running test: {}", self.0.def_path_debug_str(did));
@@ -66,7 +66,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
6666
excluded_env_vars: vec![],
6767
args: vec![],
6868
seed: None,
69-
tracked_id: None,
69+
tracked_pointer_tag: None,
7070
};
7171
miri::eval_main(tcx, entry_def_id, config);
7272

src/bin/miri.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ fn main() {
126126
let mut communicate = false;
127127
let mut ignore_leaks = false;
128128
let mut seed: Option<u64> = None;
129-
let mut tracked_id: Option<miri::PtrId> = None;
129+
let mut tracked_pointer_tag: Option<miri::PtrId> = None;
130130
let mut rustc_args = vec![];
131131
let mut miri_args = vec![];
132132
let mut after_dashdash = false;
@@ -177,15 +177,15 @@ fn main() {
177177
arg if arg.starts_with("-Zmiri-env-exclude=") => {
178178
excluded_env_vars.push(arg.trim_start_matches("-Zmiri-env-exclude=").to_owned());
179179
},
180-
arg if arg.starts_with("-Zmiri-track-id=") => {
181-
let id: u64 = match arg.trim_start_matches("-Zmiri-track-id=").parse() {
180+
arg if arg.starts_with("-Zmiri-track-pointer-tag=") => {
181+
let id: u64 = match arg.trim_start_matches("-Zmiri-track-pointer-tag=").parse() {
182182
Ok(id) => id,
183-
Err(err) => panic!("-Zmiri-track-id requires a valid `u64` as the argument: {}", err),
183+
Err(err) => panic!("-Zmiri-track-pointer-tag requires a valid `u64` as the argument: {}", err),
184184
};
185185
if let Some(id) = miri::PtrId::new(id) {
186-
tracked_id = Some(id);
186+
tracked_pointer_tag = Some(id);
187187
} else {
188-
panic!("-Zmiri-track-id must be a nonzero id");
188+
panic!("-Zmiri-track-pointer-tag must be a nonzero id");
189189
}
190190
},
191191
_ => {
@@ -220,7 +220,7 @@ fn main() {
220220
excluded_env_vars,
221221
seed,
222222
args: miri_args,
223-
tracked_id,
223+
tracked_pointer_tag,
224224
};
225225
rustc_driver::install_ice_hook();
226226
let result = rustc_driver::catch_fatal_errors(move || {

src/eval.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub struct MiriConfig {
2727
/// The seed to use when non-determinism or randomness are required (e.g. ptr-to-int cast, `getrandom()`).
2828
pub seed: Option<u64>,
2929
/// The stacked borrow id to report about
30-
pub tracked_id: Option<PtrId>,
30+
pub tracked_pointer_tag: Option<PtrId>,
3131
}
3232

3333
/// Details of premature program termination.
@@ -49,7 +49,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
4949
tcx.at(syntax::source_map::DUMMY_SP),
5050
ty::ParamEnv::reveal_all(),
5151
Evaluator::new(config.communicate),
52-
MemoryExtra::new(StdRng::seed_from_u64(config.seed.unwrap_or(0)), config.validate, config.tracked_id),
52+
MemoryExtra::new(StdRng::seed_from_u64(config.seed.unwrap_or(0)), config.validate, config.tracked_pointer_tag),
5353
);
5454
// Complete initialization.
5555
EnvVars::init(&mut ecx, config.excluded_env_vars);

src/machine.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ pub struct MemoryExtra {
7777
}
7878

7979
impl MemoryExtra {
80-
pub fn new(rng: StdRng, validate: bool, tracked_id: Option<PtrId>) -> Self {
80+
pub fn new(rng: StdRng, validate: bool, tracked_pointer_tag: Option<PtrId>) -> Self {
8181
MemoryExtra {
82-
stacked_borrows: Rc::new(RefCell::new(GlobalState::new(tracked_id))),
82+
stacked_borrows: Rc::new(RefCell::new(GlobalState::new(tracked_pointer_tag))),
8383
intptrcast: Default::default(),
8484
rng: RefCell::new(rng),
8585
validate,

src/stacked_borrows.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ pub struct GlobalState {
106106
/// Those call IDs corresponding to functions that are still running.
107107
active_calls: HashSet<CallId>,
108108
/// The id to trace in this execution run
109-
tracked_id: Option<PtrId>,
109+
tracked_pointer_tag: Option<PtrId>,
110110
}
111111
/// Memory extra state gives us interior mutable access to the global state.
112112
pub type MemoryExtra = Rc<RefCell<GlobalState>>;
@@ -154,13 +154,13 @@ impl fmt::Display for RefKind {
154154

155155
/// Utilities for initialization and ID generation
156156
impl GlobalState {
157-
pub fn new(tracked_id: Option<PtrId>) -> Self {
157+
pub fn new(tracked_pointer_tag: Option<PtrId>) -> Self {
158158
GlobalState {
159159
next_ptr_id: NonZeroU64::new(1).unwrap(),
160160
base_ptr_ids: HashMap::default(),
161161
next_call_id: NonZeroU64::new(1).unwrap(),
162162
active_calls: HashSet::default(),
163-
tracked_id,
163+
tracked_pointer_tag,
164164
}
165165
}
166166

@@ -272,7 +272,7 @@ impl<'tcx> Stack {
272272
/// Check if the given item is protected.
273273
fn check_protector(item: &Item, tag: Option<Tag>, global: &GlobalState) -> InterpResult<'tcx> {
274274
if let Tag::Tagged(id) = item.tag {
275-
if Some(id) == global.tracked_id {
275+
if Some(id) == global.tracked_pointer_tag {
276276
throw_unsup!(Unsupported(format!("disabling item {:?} for tag {:?}", item, tag)));
277277
}
278278
}

tests/compile-fail/stacked_borrows/track_id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -Zmiri-track-id=1372
1+
// compile-flags: -Zmiri-track-pointer-tag=1372
22
// do not run on anything but x86_64 linux, because minor libstd changes can change the borrow stack ids
33
// only-x86_64
44
// only-linux

0 commit comments

Comments
 (0)