Skip to content

Commit c69ebaa

Browse files
committed
Use names that actually represent what's going on
1 parent 90a8f2f commit c69ebaa

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/diagnostics.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,19 @@ pub fn report_msg<'tcx, 'mir>(
7777
}
7878

7979
thread_local! {
80-
static ECX: RefCell<Vec<NonHaltingDiagnostic>> = RefCell::new(Vec::new());
80+
static DIAGNOSTICS: RefCell<Vec<NonHaltingDiagnostic>> = RefCell::new(Vec::new());
8181
}
8282

83-
pub fn register_err(e: NonHaltingDiagnostic) {
84-
ECX.with(|ecx| ecx.borrow_mut().push(e));
83+
pub fn register_diagnostic(e: NonHaltingDiagnostic) {
84+
DIAGNOSTICS.with(|diagnostics| diagnostics.borrow_mut().push(e));
8585
}
8686

8787
impl<'mir, 'tcx> EvalContextExt<'mir, 'tcx> for crate::MiriEvalContext<'mir, 'tcx> {}
8888
pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx> {
89-
fn process_errors(&self) {
89+
fn process_diagnostics(&self) {
9090
let this = self.eval_context_ref();
91-
ECX.with(|ecx| {
92-
for e in ecx.borrow_mut().drain(..) {
91+
DIAGNOSTICS.with(|diagnostics| {
92+
for e in diagnostics.borrow_mut().drain(..) {
9393
let msg = match e {
9494
NonHaltingDiagnostic::PoppedTrackedPointerTag(item) =>
9595
format!("popped tracked tag for item {:?}", item),

src/eval.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ pub fn eval_main<'tcx>(tcx: TyCtxt<'tcx>, main_id: DefId, config: MiriConfig) ->
183183
// Perform the main execution.
184184
let res: InterpResult<'_, i64> = (|| {
185185
while ecx.step()? {
186-
ecx.process_errors();
186+
ecx.process_diagnostics();
187187
}
188188
// Read the return code pointer *before* we run TLS destructors, to assert
189189
// that it was written to by the time that `start` lang item returned.

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub use crate::shims::tls::{EvalContextExt as TlsEvalContextExt, TlsData};
4343
pub use crate::shims::EvalContextExt as ShimsEvalContextExt;
4444

4545
pub use crate::diagnostics::{
46-
register_err, report_err, EvalContextExt as DiagnosticsEvalContextExt, NonHaltingDiagnostic,
46+
register_diagnostic, report_err, EvalContextExt as DiagnosticsEvalContextExt, NonHaltingDiagnostic,
4747
};
4848
pub use crate::eval::{create_ecx, eval_main, MiriConfig, TerminationInfo};
4949
pub use crate::helpers::EvalContextExt as HelpersEvalContextExt;

src/stacked_borrows.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ impl<'tcx> Stack {
266266
fn check_protector(item: &Item, tag: Option<Tag>, global: &GlobalState) -> InterpResult<'tcx> {
267267
if let Tag::Tagged(id) = item.tag {
268268
if Some(id) == global.tracked_pointer_tag {
269-
register_err(NonHaltingDiagnostic::PoppedTrackedPointerTag(item.clone()));
269+
register_diagnostic(NonHaltingDiagnostic::PoppedTrackedPointerTag(item.clone()));
270270
}
271271
}
272272
if let Some(call) = item.protector {

0 commit comments

Comments
 (0)