Skip to content

Commit e4cda06

Browse files
committed
fix unqualified_local_imports in Miri
1 parent 4165114 commit e4cda06

File tree

28 files changed

+61
-59
lines changed

28 files changed

+61
-59
lines changed

src/tools/miri/src/borrow_tracker/stacked_borrows/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ use crate::borrow_tracker::{
2121
use crate::concurrency::data_race::{NaReadType, NaWriteType};
2222
use crate::*;
2323

24-
use diagnostics::{RetagCause, RetagInfo};
25-
pub use item::{Item, Permission};
26-
pub use stack::Stack;
24+
use self::diagnostics::{RetagCause, RetagInfo};
25+
pub use self::item::{Item, Permission};
26+
pub use self::stack::Stack;
2727

2828
pub type AllocState = Stacks;
2929

src/tools/miri/src/borrow_tracker/tree_borrows/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ pub(super) struct TbError<'node> {
301301
impl TbError<'_> {
302302
/// Produce a UB error.
303303
pub fn build<'tcx>(self) -> InterpError<'tcx> {
304-
use TransitionError::*;
304+
use self::TransitionError::*;
305305
let cause = self.access_cause;
306306
let accessed = self.accessed_info;
307307
let conflicting = self.conflicting_info;

src/tools/miri/src/borrow_tracker/tree_borrows/exhaustive.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ macro_rules! precondition {
1414
}
1515
};
1616
}
17+
#[cfg_attr(not(bootstrap), allow(unclear_local_imports))]
1718
pub(crate) use precondition;
1819

1920
// Trivial impls of `Exhaustive` for the standard types with 0, 1 and 2 elements respectively.

src/tools/miri/src/borrow_tracker/tree_borrows/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ mod unimap;
2323
#[cfg(test)]
2424
mod exhaustive;
2525

26-
use perms::Permission;
27-
pub use tree::Tree;
26+
use self::perms::Permission;
27+
pub use self::tree::Tree;
2828

2929
pub type AllocState = Tree;
3030

src/tools/miri/src/borrow_tracker/tree_borrows/perms.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ enum PermissionPriv {
3636
/// rejects: all child accesses (UB).
3737
Disabled,
3838
}
39-
use PermissionPriv::*;
39+
use self::PermissionPriv::*;
4040

4141
impl PartialOrd for PermissionPriv {
4242
/// PermissionPriv is ordered by the reflexive transitive closure of
@@ -487,14 +487,14 @@ mod propagation_optimization_checks {
487487

488488
impl Exhaustive for AccessKind {
489489
fn exhaustive() -> Box<dyn Iterator<Item = Self>> {
490-
use AccessKind::*;
490+
use self::AccessKind::*;
491491
Box::new(vec![Read, Write].into_iter())
492492
}
493493
}
494494

495495
impl Exhaustive for AccessRelatedness {
496496
fn exhaustive() -> Box<dyn Iterator<Item = Self>> {
497-
use AccessRelatedness::*;
497+
use self::AccessRelatedness::*;
498498
Box::new(vec![This, StrictChildAccess, AncestorAccess, DistantAccess].into_iter())
499499
}
500500
}
@@ -503,7 +503,7 @@ mod propagation_optimization_checks {
503503
// For any kind of access, if we do it twice the second should be a no-op.
504504
// Even if the protector has disappeared.
505505
fn all_transitions_idempotent() {
506-
use transition::*;
506+
use self::transition::*;
507507
for old in PermissionPriv::exhaustive() {
508508
for (old_protected, new_protected) in <(bool, bool)>::exhaustive() {
509509
// Protector can't appear out of nowhere: either the permission was
@@ -529,7 +529,7 @@ mod propagation_optimization_checks {
529529
#[test]
530530
#[rustfmt::skip]
531531
fn foreign_read_is_noop_after_foreign_write() {
532-
use transition::*;
532+
use self::transition::*;
533533
let old_access = AccessKind::Write;
534534
let new_access = AccessKind::Read;
535535
for old in PermissionPriv::exhaustive() {

src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ impl AccessRelatedness {
798798
/// for the child node. This function assumes that we propagate away from the initial
799799
/// access.
800800
pub fn for_child(self) -> Self {
801-
use AccessRelatedness::*;
801+
use self::AccessRelatedness::*;
802802
match self {
803803
AncestorAccess | This => AncestorAccess,
804804
StrictChildAccess | DistantAccess => DistantAccess,

src/tools/miri/src/borrow_tracker/tree_borrows/tree/tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ mod spurious_read {
135135

136136
impl Exhaustive for PtrSelector {
137137
fn exhaustive() -> Box<dyn Iterator<Item = Self>> {
138-
use PtrSelector::*;
138+
use self::PtrSelector::*;
139139
Box::new(vec![X, Y, Other].into_iter())
140140
}
141141
}
@@ -152,7 +152,7 @@ mod spurious_read {
152152

153153
impl Exhaustive for RelPosXY {
154154
fn exhaustive() -> Box<dyn Iterator<Item = Self>> {
155-
use RelPosXY::*;
155+
use self::RelPosXY::*;
156156
Box::new(vec![MutuallyForeign, XChildY].into_iter())
157157
}
158158
}
@@ -178,7 +178,7 @@ mod spurious_read {
178178
/// or an `AncestorAccess` relative to `y`, but it doesn't really matter
179179
/// because `DistantAccess.is_foreign() == AncestorAccess.is_foreign()`).
180180
fn rel_pair(self, xy_rel: RelPosXY) -> (AccessRelatedness, AccessRelatedness) {
181-
use AccessRelatedness::*;
181+
use self::AccessRelatedness::*;
182182
match xy_rel {
183183
RelPosXY::MutuallyForeign =>
184184
match self {

src/tools/miri/src/concurrency/data_race.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ trait EvalContextPrivExt<'tcx>: MiriInterpCxExt<'tcx> {
12661266
place: &MPlaceTy<'tcx>,
12671267
atomic: AtomicRwOrd,
12681268
) -> InterpResult<'tcx> {
1269-
use AtomicRwOrd::*;
1269+
use self::AtomicRwOrd::*;
12701270
let acquire = matches!(atomic, Acquire | AcqRel | SeqCst);
12711271
let release = matches!(atomic, Release | AcqRel | SeqCst);
12721272
let this = self.eval_context_mut();

src/tools/miri/src/concurrency/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ pub mod thread;
77
mod vector_clock;
88
pub mod weak_memory;
99

10-
pub use vector_clock::VClock;
10+
pub use self::vector_clock::VClock;

src/tools/miri/src/diagnostics.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub struct RacingOp {
5959

6060
impl fmt::Display for TerminationInfo {
6161
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
62-
use TerminationInfo::*;
62+
use self::TerminationInfo::*;
6363
match self {
6464
Exit { code, .. } => write!(f, "the evaluated program completed with exit code {code}"),
6565
Abort(msg) => write!(f, "{msg}"),
@@ -212,7 +212,7 @@ pub fn report_error<'tcx>(
212212

213213
let (title, helps) = if let MachineStop(info) = e.kind() {
214214
let info = info.downcast_ref::<TerminationInfo>().expect("invalid MachineStop payload");
215-
use TerminationInfo::*;
215+
use self::TerminationInfo::*;
216216
let title = match info {
217217
Exit { code, leak_check } => return Some((*code, *leak_check)),
218218
Abort(_) => Some("abnormal termination"),
@@ -584,7 +584,7 @@ pub fn report_msg<'tcx>(
584584

585585
impl<'tcx> MiriMachine<'tcx> {
586586
pub fn emit_diagnostic(&self, e: NonHaltingDiagnostic) {
587-
use NonHaltingDiagnostic::*;
587+
use self::NonHaltingDiagnostic::*;
588588

589589
let stacktrace = Frame::generate_stacktrace_from_stack(self.threads.active_thread_stack());
590590
let (stacktrace, _was_pruned) = prune_stacktrace(stacktrace, self);

0 commit comments

Comments
 (0)