Skip to content

Commit 6636681

Browse files
committed
let rustfmt format imports
1 parent 380467d commit 6636681

File tree

93 files changed

+255
-319
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+255
-319
lines changed

bench-cargo-miri/backtraces/src/main.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
//! Extracted from the backtrace crate's test test_frame_conversion
22
3-
use backtrace::{Backtrace, BacktraceFrame};
43
use std::fmt::Write;
54

5+
use backtrace::{Backtrace, BacktraceFrame};
6+
67
fn main() {
78
let mut frames = vec![];
89
backtrace::trace(|frame| {

bench-cargo-miri/serde2/src/main.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// Like serde1, but in two threads concurrently. And we don't print.
22
static JSON: &str = r#"{"buffer":[-29,-42,-40,-37,-28,-5,-21,1,-24,-8,-20,4,-18,26,-24,44,-26,66,-30,86,-37,88,-41,72,-46,50,-31,28,23,14,64,16,51,26,32,34,39,42,48,35,58,0,72,-36,69,-59,58,-98,54,-124,36,-103,12,-110,5,-173,-19,-146,-59,-4,-42,51,1,-23,-6,-30,-6,45,46,47,70,6,55,19,60,38,62,42,47,61,46,40,42,-19,22,-34,6,-35,-50,-61,-141,-37,-171,17,-163,26,-180,46,-154,80,-63,48,-4,18,20,50,47,58,53,44,61,57,85,37,80,0,86,-8,106,-95,49,-213,-8,-131,47,49,63,40,-39,-69,-74,-37,-20,63,-12,58,-14,-12,25,-31,41,11,45,76,47,167,5,261,-37,277,-83,183,-172,35,-122,-79,138,-70,266,69,124,228,0,391,-29,594,-84,702,-78,627,-8,551,-13,509,13,372,120,352,125,622,127,691,223,362,126,386,-33,915,198,958,457,456,298,500,233,1027,469,1096,426,918,160,1067,141,1220,189,1245,164,1375,297,1378,503,1299,702,1550,929,1799,855,1752,547,1830,602,1928,832,1736,796,1735,933,1961,1385,1935,1562,2105,1485,2716,1449,2948,1305,2768,1205,2716,1346,2531,1450,2470,1653,3117,2111,3370,2176,2696,1947,2925,2305,3846,2658,2425,2184,-877,1981,-2261,2623,-1645,2908,-1876,2732,-2704,2953,-2484,3116,-2120,2954,-2442,3216,-2466,3499,-2192,3234,-2392,3361,-2497,3869,-2078,3772,-1858,3915,-2066,4438,-2285,2934,-2294,-280,-2066,-1762,-1992,-1412,-2298,-1535,-2399,-1789,-2223,-1419,-2244,-1334,-2092,-1476,-1777,-1396,-2014,-1571,-2199,-1574,-1843,-1167,-1910,-1446,-2007,-1818,-1506,-1331,-2526,-2048,-5535,-4573,-7148,-5828,-6422,-5327,-5840,-5488,-5992,-6144,-6014,-6164,-6109,-6234,-6271,-6388,-6288,-6156,-6517,-6249,-6794,-6602,-6822,-6418,-6788,-6245,-6490,-6560,-6394,-6794,-7920,-6937,-10397,-7140,-11428,-6972,-11019,-6610,-11141,-6665,-11913,-7046,-11979,-7235,-11599,-7015,-11854,-6912,-12161,-7441,-12136,-7761,-12861,-7292,-13390,-7254,-12345,-7809,-12490,-7463,-13983,-6969,-10489,-8465,-2382,-11054,1272,-12247,-270,-12060,-323,-12113,502,-12486,-697,-12251,-1086,-12141,-181,-13116,-670,-13509,-1173,-12592,-443,-12811,-449,-13698,-934,-12850,-747,-13083,-873,-15036,-1161,-11478,-1047,-2669,-1407,1006,-1658,-1146,-1195,-1297,-1421,-73,-1946,-977,-1590,-1499,-1577,-1010,-1862,-1256,-1389,-962,-1692,-509,-2613,-1317,-2087,-1359,-1997,-1034,-2891,-2024,-119,-84,5651,5723,8074,8306,7156,6870,6985,7106,7312,8403,7114,8096,7173,7848,7082,7827,6761,7189,6985,7368,7076,7835,6992,7297,7453,7260,7016,7755,6025,7429,8533,7352,14150,7628,17142,7077,16399,6947,15939,7475,16564,7069,16463,6882,16400,7602,17031,7233,16543,6517,15395,7018,15985,7104,16689,6869,15655,7622,16155,7198,17884,6022,14056,8856,5665,14484,1815,16782,3034,15786,3107,15664,2312,16517,2965,16443,3036,16120,2287,16584,2479,16720,2693,16073,2535,16159,2958,16609,3067,16086,2716,16579,3035,17752,3092,13704,2499,5265,2620,1452,2808,3024,2444,3275,2839,2267,3340,2857,2968,3232,3066,2867,3152,3072,2248,2961,2413,2807,3238,3237,2368,2699,2262,2392,3537,3339,827,823,-5020,-5359,-7095,-7857,-5973,-6274,-6208,-6279,-6934,-7181,-6893,-6647,-7146,-6687,-7026,-7328,-6451,-6924,-6763,-6535,-7109,-6639,-6926,-6559,-7188,-6799,-6727,-6955,-5786,-6554,-8543,-6796,-14465,-7190,-17356,-6641,-16372,-6529,-15941,-6898,-16526,-6434,-16219,-6520,-16222,-7449,-17077,-7097,-16665,-6476,-15675,-7026,-16498,-6848,-17147,-6271,-15894,-7069,-16266,-7032,-17817,-5991,-13796,-8594,-5421,-14349,-1649,-17288,-2847,-16525,-2974,-15945,-2324,-16482,-3022,-16593,-3097,-16451,-2420,-16780,-2649,-16641,-2836,-15900,-2660,-16214,-3050,-16827,-3111,-15993,-2741,-16151,-2994,-17537,-2933,-13812,-2314,-5216,-2475,-1125,-2648,-2801,-2290,-3285,-2796,-2243,-3415,-2642,-3109,-3000,-3271,-2839,-3408,-3161,-2497,-2876,-2603,-2570,-3351,-3173,-2416,-2832,-2235,-2408,-3405,-3186,-613,-768,5271,5201,7376,7644,6241,6176,6366,6275,6964,7124,6831,6508,6998,6566,6836,7230,6277,6777,6589,6376,6934,6536,6819,6494,7160,6749,6736,6900,5822,6476,8593,6747,14520,7204,17448,6637,16490,6483,16033,6906,16600,6511,16304,6568,16279,7438,17079,7072,16624,6463,15577,7028,16343,6877,16990,6331,15760,7121,16140,7023,17719,5944,13748,8575,5401,14336,1645,17210,2880,16419,3036,15896,2382,16483,3074,16584,3143,16425,2443,16782,2650,16695,2825,15978,2632,16272,3015,16880,3084,16096,2709,16289,2965,17641,2932,13887,2323,5330,2474,1286,2656,2954,2309,3410,2803,2373,3414,2795,3106,3151,3263,2952,3403,3241,2483,2969,2568,2681,3316,3245,2383,2837,2199,2390,3396,3165,641,706,-5230,-5323,-7307,-7790,-6136,-6317,-6268,-6419,-6884,-7278,-6766,-6666,-6976,-6731,-6853,-7406,-6308,-6958,-6636,-6553,-6978,-6703,-6829,-6647,-7156,-6883,-6737,-7017,-5814,-6581,-8575,-6833,-14490,-7270,-17411,-6699,-16466,-6539,-16016,-6931,-16571,-6504,-16257,-6551,-16202,-7408,-16983,-7021,-16545,-6410,-15512,-6976,-16305,-6803,-17017,-6243,-15820,-7037,-16197,-6923,-17802,-5820,-13840,-8455,-5475,-14227,-1724,-17099,-2923,-16314,-3008,-15801,-2362,-16392,-3088,-16506,-3163,-16356,-2503,-16700,-2717,-16605,-2855,-15904,-2710,-16226,-3108,-16870,-3089,-16101,-2747,-16257,-3087,-17584,-2975,-13868,-2324,-5343,-2548,-1275,-2673,-2917,-2213,-3363,-2694,-2311,-3251,-2744,-2867,-3129,-3034,-2939,-3190,-3234,-2346,-2964,-2639,-2658,-3558,-3241,-2670,-2892,-2453,-2437,-3564,-3175,-771,-779,5105,5171,7308,7655,6265,6204,6397,6288,7024,7172,6903,6586,7002,6627,6777,7308,6190,6889,6537,6465,7011,6613,6985,6631,7393,6934,7073,7072,6112,6615,8751,6859,14672,7282,17448,6652,16146,6448,15565,6899,16151,6547,15860,6591,16048,7446,17065,7064,16661,6368,15774,6857,16524,6677,16825,6071,15577,6900,16119,7040,17490,6118,13495,8696,5432,14446,1678,17366,3036,16488,3624,15834,3012,16382,3575,16465,3685,16301,2815,16708,2982,16679,3356,15952,2934,16049,3290,16352,3964,15605,3612,16222,3647,17764,4272,13865,3977,5384,3592,1580,3794,3243,3627,3670,3622,2758,4007,3130,3835,3294,3964,3065,4468,3408,3933,3234,3789,3118,4634,3643,4211,3174,4155,3176,5512,4400,2792,1730,-3702,-4499,-5940,-6691,-4265,-5094,-4381,-5215,-4918,-5746,-4217,-4871,-4402,-4981,-4479,-5525,-3732,-4968,-4118,-4924,-4300,-5349,-3422,-5021,-3876,-4886,-4087,-4860,-2790,-4254,-5025,-4196,-10898,-4415,-13419,-4007,-12198,-4121,-11995,-4413,-12471,-3808,-11937,-3920,-11792,-4583,-12284,-3776,-12085,-3107,-11421,-3583,-11226,-3081,-11157,-2768,-10580,-3914,-10424,-3197,-11040,-1715,-9822,-5144,-6189,-11154,-4236,-13029,-5134,-11598,-5507,-10949,-4921,-11142,-4999,-11180,-4883,-11184,-4366,-11090,-4548,-10887,-4818,-10708,-4866,-10534,-5253,-10272,-5179,-9894,-4633,-10029,-4773,-10382,-4977,-8674,-4668,-5292,-4651,-3928,-4629,-4465,-4312,-3994,-4459,-3528,-4570,-4400,-4272,-4601,-4482,-4035,-4627,-4334,-4080,-4498,-4045,-3835,-4204,-3526,-3695,-3646,-4045,-4101,-4856,-4628,-3338,-3235,-673,-508,28,147,-453,-639,11,0,8,-2,7,0,7,-3,11,-8,15,-9,17,-6,17,-5,13,-3,7,0,3,0,-2,0,-4,0,-4,-2,-6,0,-14,-2,-17,-4,-8,0,-7,5,-17,7,-18,10,-7,18,-2,25,-3,27,0,31,4,34,4,34,8,36,8,37,2,36,4,34,8,28,3,15,0,11,0,12,-5,8,-4,10,0,23,-4,31,-8,30,-2,30,0,26,-6,22,-6,20,-12,15,-19,10,-10,13,-14,6,-43,-13,-43,-16,-9,-12,-10,-29,-42,-40,-37,-28,-5,-21,1,-24,-8,-20,4,-18,26,-24,44,-26,66,-30,86,-37,88,-41,72,-46,50,-31,28,23,14,64,16,51,26,32,34,39,42,48,35,58,0,72,-36,69,-59,58,-98,54,-124,36,-103,12,-110,5,-173,-19,-146,-59,-4,-42,51,1,-23,-6,-30,-6,45,46,47,70,6,55,19,60,38,62,42,47,61,46,40,42,-19,22,-34,6,-35,-50,-61,-141,-37,-171,17,-163,26,-180,46,-154,80,-63,48,-4,18,20,50,47,58,53,44,61,57,85,37,80,0,86,-8,106,-95,49,-213,-8,-131,47,49,63,40,-39,-69,-74,-37,-20,63,-12,58,-14,-12,25,-31,41,11,45,76,47,167,5,261,-37,277,-83,183,-172,35,-122,-79,138,-70,266,69,124,228,0,391,-29,594,-84,702,-78,627,-8,551,-13,509,13,372,120,352,125,622,127,691,223,362,126,386,-33,915,198,958,457,456,298,500,233,1027,469,1096,426,918,160,1067,141,1220,189,1245,164,1375,297,1378,503,1299,702,1550,929,1799,855,1752,547,1830,602,1928,832,1736,796,1735,933,1961,1385,1935,1562,2105,1485,2716,1449,2948,1305,2768,1205,2716,1346,2531,1450,2470,1653,3117,2111,3370,2176,2696,1947,2925,2305,3846,2658,2425,2184,-877,1981,-2261,2623,-1645,2908,-1876,2732,-2704,2953,-2484,3116,-2120,2954,-2442,3216,-2466,3499,-2192,3234,-2392,3361,-2497,3869,-2078,3772,-1858,3915,-2066,4438,-2285,2934,-2294,-280,-2066,-1762,-1992,-1412,-2298,-1535,-2399,-1789,-2223,-1419,-2244,-1334,-2092,-1476,-1777,-1396,-2014,-1571,-2199,-1574,-1843,-1167,-1910,-1446,-2007,-1818,-1506,-1331,-2526,-2048,-5535,-4573,-7148,-5828,-6422,-5327,-5840,-5488,-5992,-6144,-6014,-6164,-6109,-6234,-6271,-6388,-6288,-6156,-6517,-6249,-6794,-6602,-6822,-6418,-6788,-6245,-6490,-6560,-6394,-6794,-7920,-6937,-10397,-7140,-11428,-6972,-11019,-6610,-11141,-6665,-11913,-7046,-11979,-7235,-11599,-7015,-11854,-6912,-12161,-7441,-12136,-7761,-12861,-7292,-13390,-7254,-12345,-7809,-12490,-7463,-13983,-6969,-10489,-8465,-2382,-11054,1272,-12247,-270,-12060,-323,-12113,502,-12486,-697,-12251,-1086,-12141,-181,-13116,-670,-13509,-1173,-12592,-443,-12811,-449,-13698,-934,-12850,-747,-13083,-873,-15036,-1161,-11478,-1047,-2669,-1407,1006,-1658,-1146,-1195,-1297,-1421,-73,-1946,-977,-1590,-1499,-1577,-1010,-1862,-1256,-1389,-962,-1692,-509,-2613,-1317,-2087,-1359,-1997,-1034,-2891,-2024,-119,-84,5651,5723,8074,8306,7156,6870,6985,7106,7312,8403,7114,8096,7173,7848,7082,7827,6761,7189,6985,7368]}"#;
33

4-
use serde::Deserialize;
54
use std::thread;
65

6+
use serde::Deserialize;
7+
78
#[derive(Deserialize)]
89
#[allow(unused)]
910
struct DeriveStruct {

cargo-miri/src/phases.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ use std::{env, thread};
88

99
use rustc_version::VersionMeta;
1010

11-
use crate::{setup::*, util::*};
11+
use crate::setup::*;
12+
use crate::util::*;
1213

1314
const CARGO_MIRI_HELP: &str = r"Runs binary crates and tests in Miri
1415

miri-script/src/args.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use std::env;
2-
use std::iter;
1+
use std::{env, iter};
32

43
use anyhow::{Result, bail};
54

miri-script/src/commands.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
use std::env;
21
use std::ffi::{OsStr, OsString};
32
use std::io::Write;
4-
use std::net;
5-
use std::ops::Not;
6-
use std::ops::Range;
3+
use std::ops::{Not, Range};
74
use std::path::PathBuf;
8-
use std::process;
95
use std::time::Duration;
6+
use std::{env, net, process};
107

118
use anyhow::{Context, Result, anyhow, bail};
129
use path_macro::path;

rustfmt.toml

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
# This matches rustc
12
style_edition = "2024"
23
use_small_heuristics = "Max"
4+
group_imports = "StdExternalCrate"
5+
imports_granularity = "Module"
6+
7+
# Miri-specific settings
8+
force_multiline_blocks = true
39
match_arm_blocks = false
410
match_arm_leading_pipes = "Preserve"
5-
force_multiline_blocks = true

src/alloc_addresses/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ use std::cell::RefCell;
77
use std::cmp::max;
88

99
use rand::Rng;
10-
1110
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
1211
use rustc_span::Span;
1312
use rustc_target::abi::{Align, Size};
1413

15-
use crate::{concurrency::VClock, *};
16-
1714
use self::reuse_pool::ReusePool;
15+
use crate::concurrency::VClock;
16+
use crate::*;
1817

1918
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
2019
pub enum ProvenanceMode {

src/alloc_addresses/reuse_pool.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//! Manages a pool of addresses that can be reused.
22
33
use rand::Rng;
4-
54
use rustc_target::abi::{Align, Size};
65

7-
use crate::{MemoryKind, MiriConfig, ThreadId, concurrency::VClock};
6+
use crate::concurrency::VClock;
7+
use crate::{MemoryKind, MiriConfig, ThreadId};
88

99
const MAX_POOL_SIZE: usize = 64;
1010

src/alloc_bytes.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
use std::alloc;
21
use std::alloc::Layout;
32
use std::borrow::Cow;
4-
use std::slice;
3+
use std::{alloc, slice};
54

65
use rustc_middle::mir::interpret::AllocBytes;
76
use rustc_target::abi::{Align, Size};

src/bin/miri.rs

+9-13
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,27 @@ use std::num::NonZero;
2828
use std::path::PathBuf;
2929
use std::str::FromStr;
3030

31-
use tracing::debug;
32-
31+
use miri::{BacktraceStyle, BorrowTrackerMethod, ProvenanceMode, RetagFields, ValidationMode};
3332
use rustc_data_structures::sync::Lrc;
3433
use rustc_driver::Compilation;
3534
use rustc_hir::def_id::LOCAL_CRATE;
3635
use rustc_hir::{self as hir, Node};
3736
use rustc_hir_analysis::check::check_function_signature;
3837
use rustc_interface::interface::Config;
39-
use rustc_middle::{
40-
middle::{
41-
codegen_fn_attrs::CodegenFnAttrFlags,
42-
exported_symbols::{ExportedSymbol, SymbolExportInfo, SymbolExportKind, SymbolExportLevel},
43-
},
44-
query::LocalCrate,
45-
traits::{ObligationCause, ObligationCauseCode},
46-
ty::{self, Ty, TyCtxt},
47-
util::Providers,
38+
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
39+
use rustc_middle::middle::exported_symbols::{
40+
ExportedSymbol, SymbolExportInfo, SymbolExportKind, SymbolExportLevel,
4841
};
42+
use rustc_middle::query::LocalCrate;
43+
use rustc_middle::traits::{ObligationCause, ObligationCauseCode};
44+
use rustc_middle::ty::{self, Ty, TyCtxt};
45+
use rustc_middle::util::Providers;
4946
use rustc_session::config::{CrateType, EntryFnType, ErrorOutputType, OptLevel};
5047
use rustc_session::search_paths::PathKind;
5148
use rustc_session::{CtfeBacktrace, EarlyDiagCtxt};
5249
use rustc_span::def_id::DefId;
5350
use rustc_target::spec::abi::Abi;
54-
55-
use miri::{BacktraceStyle, BorrowTrackerMethod, ProvenanceMode, RetagFields, ValidationMode};
51+
use tracing::debug;
5652

5753
struct MiriCompilerCalls {
5854
miri_config: miri::MiriConfig,

src/borrow_tracker/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ use std::cell::RefCell;
22
use std::fmt;
33
use std::num::NonZero;
44

5-
use smallvec::SmallVec;
6-
75
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
86
use rustc_middle::mir::RetagKind;
97
use rustc_target::abi::Size;
8+
use smallvec::SmallVec;
109

1110
use crate::*;
1211
pub mod stacked_borrows;

src/borrow_tracker/stacked_borrows/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use smallvec::SmallVec;
21
use std::fmt;
32

43
use rustc_data_structures::fx::FxHashSet;
54
use rustc_span::{Span, SpanData};
65
use rustc_target::abi::Size;
6+
use smallvec::SmallVec;
77

88
use crate::borrow_tracker::{GlobalStateInner, ProtectorKind};
99
use crate::*;

src/borrow_tracker/stacked_borrows/mod.rs

+9-10
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,24 @@ mod item;
66
mod stack;
77

88
use std::cell::RefCell;
9-
use std::cmp;
109
use std::fmt::Write;
11-
use std::mem;
10+
use std::{cmp, mem};
1211

1312
use rustc_data_structures::fx::FxHashSet;
1413
use rustc_middle::mir::{Mutability, RetagKind};
15-
use rustc_middle::ty::{self, Ty, layout::HasParamEnv};
14+
use rustc_middle::ty::layout::HasParamEnv;
15+
use rustc_middle::ty::{self, Ty};
1616
use rustc_target::abi::{Abi, Size};
1717

18-
use crate::borrow_tracker::{
19-
GlobalStateInner, ProtectorKind,
20-
stacked_borrows::diagnostics::{AllocHistory, DiagnosticCx, DiagnosticCxBuilder},
21-
};
22-
use crate::concurrency::data_race::{NaReadType, NaWriteType};
23-
use crate::*;
24-
2518
use self::diagnostics::{RetagCause, RetagInfo};
2619
pub use self::item::{Item, Permission};
2720
pub use self::stack::Stack;
21+
use crate::borrow_tracker::stacked_borrows::diagnostics::{
22+
AllocHistory, DiagnosticCx, DiagnosticCxBuilder,
23+
};
24+
use crate::borrow_tracker::{GlobalStateInner, ProtectorKind};
25+
use crate::concurrency::data_race::{NaReadType, NaWriteType};
26+
use crate::*;
2827

2928
pub type AllocState = Stacks;
3029

src/borrow_tracker/stacked_borrows/stack.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ use rustc_data_structures::fx::FxHashSet;
55
use tracing::trace;
66

77
use crate::ProvenanceExtra;
8-
use crate::borrow_tracker::{
9-
AccessKind, BorTag,
10-
stacked_borrows::{Item, Permission},
11-
};
8+
use crate::borrow_tracker::stacked_borrows::{Item, Permission};
9+
use crate::borrow_tracker::{AccessKind, BorTag};
1210

1311
/// Exactly what cache size we should use is a difficult trade-off. There will always be some
1412
/// workload which has a `BorTag` working set which exceeds the size of the cache, and ends up

src/borrow_tracker/tree_borrows/diagnostics.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ use rustc_data_structures::fx::FxHashMap;
55
use rustc_span::{Span, SpanData};
66

77
use crate::borrow_tracker::ProtectorKind;
8-
use crate::borrow_tracker::tree_borrows::{
9-
perms::{PermTransition, Permission},
10-
tree::LocationState,
11-
unimap::UniIndex,
12-
};
8+
use crate::borrow_tracker::tree_borrows::perms::{PermTransition, Permission};
9+
use crate::borrow_tracker::tree_borrows::tree::LocationState;
10+
use crate::borrow_tracker::tree_borrows::unimap::UniIndex;
1311
use crate::*;
1412

1513
/// Cause of an access: either a real access or one

src/borrow_tracker/tree_borrows/mod.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
use rustc_middle::{
2-
mir::{Mutability, RetagKind},
3-
ty::{self, Ty, layout::HasParamEnv},
4-
};
1+
use rustc_middle::mir::{Mutability, RetagKind};
2+
use rustc_middle::ty::layout::HasParamEnv;
3+
use rustc_middle::ty::{self, Ty};
54
use rustc_span::def_id::DefId;
65
use rustc_target::abi::{Abi, Size};
76

7+
use crate::borrow_tracker::{GlobalState, GlobalStateInner, ProtectorKind};
8+
use crate::concurrency::data_race::NaReadType;
89
use crate::*;
9-
use crate::{
10-
borrow_tracker::{GlobalState, GlobalStateInner, ProtectorKind},
11-
concurrency::data_race::NaReadType,
12-
};
1310

1411
pub mod diagnostics;
1512
mod perms;

src/borrow_tracker/tree_borrows/tree.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,17 @@
1212
1313
use std::{fmt, mem};
1414

15-
use smallvec::SmallVec;
16-
1715
use rustc_data_structures::fx::FxHashSet;
1816
use rustc_span::Span;
1917
use rustc_target::abi::Size;
18+
use smallvec::SmallVec;
2019

21-
use crate::borrow_tracker::tree_borrows::{
22-
Permission,
23-
diagnostics::{self, NodeDebugInfo, TbError, TransitionError},
24-
perms::PermTransition,
25-
unimap::{UniEntry, UniIndex, UniKeyMap, UniValMap},
20+
use crate::borrow_tracker::tree_borrows::Permission;
21+
use crate::borrow_tracker::tree_borrows::diagnostics::{
22+
self, NodeDebugInfo, TbError, TransitionError,
2623
};
24+
use crate::borrow_tracker::tree_borrows::perms::PermTransition;
25+
use crate::borrow_tracker::tree_borrows::unimap::{UniEntry, UniIndex, UniKeyMap, UniValMap};
2726
use crate::borrow_tracker::{GlobalState, ProtectorKind};
2827
use crate::*;
2928

src/borrow_tracker/tree_borrows/tree/tests.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
//! Tests for the tree
22
#![cfg(test)]
33

4+
use std::fmt;
5+
46
use super::*;
57
use crate::borrow_tracker::tree_borrows::exhaustive::{Exhaustive, precondition};
6-
use std::fmt;
78

89
impl Exhaustive for LocationState {
910
fn exhaustive() -> Box<dyn Iterator<Item = Self>> {

src/borrow_tracker/tree_borrows/unimap.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
1313
#![allow(dead_code)]
1414

15-
use std::{hash::Hash, mem};
15+
use std::hash::Hash;
16+
use std::mem;
1617

1718
use rustc_data_structures::fx::FxHashMap;
1819

src/concurrency/data_race.rs

+8-13
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,23 @@
4040
//! code some atomic operations may increment the timestamp when not necessary but this has no effect
4141
//! on the data-race detection code.
4242
43-
use std::{
44-
cell::{Cell, Ref, RefCell, RefMut},
45-
fmt::Debug,
46-
mem,
47-
};
43+
use std::cell::{Cell, Ref, RefCell, RefMut};
44+
use std::fmt::Debug;
45+
use std::mem;
4846

4947
use rustc_ast::Mutability;
50-
use rustc_data_structures::fx::FxHashMap;
51-
use rustc_data_structures::fx::FxHashSet;
48+
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
5249
use rustc_index::{Idx, IndexVec};
53-
use rustc_middle::{mir, ty::Ty};
50+
use rustc_middle::mir;
51+
use rustc_middle::ty::Ty;
5452
use rustc_span::Span;
5553
use rustc_target::abi::{Align, HasDataLayout, Size};
5654

55+
use super::vector_clock::{VClock, VTimestamp, VectorIdx};
56+
use super::weak_memory::EvalContextExt as _;
5757
use crate::diagnostics::RacingOp;
5858
use crate::*;
5959

60-
use super::{
61-
vector_clock::{VClock, VTimestamp, VectorIdx},
62-
weak_memory::EvalContextExt as _,
63-
};
64-
6560
pub type AllocState = VClockAlloc;
6661

6762
/// Valid atomic read-write orderings, alias of atomic::Ordering (not non-exhaustive).

src/concurrency/range_object_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
//! ranges and data are discrete and non-splittable -- they represent distinct "objects". An
33
//! allocation in the map will always have the same range until explicitly removed
44
5-
use rustc_target::abi::Size;
65
use std::ops::{Index, IndexMut, Range};
76

87
use rustc_const_eval::interpret::AllocRange;
8+
use rustc_target::abi::Size;
99

1010
#[derive(Clone, Debug)]
1111
struct Elem<T> {

src/concurrency/sync.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::any::Any;
2-
use std::collections::{VecDeque, hash_map::Entry};
2+
use std::collections::VecDeque;
3+
use std::collections::hash_map::Entry;
34
use std::ops::Not;
45
use std::time::Duration;
56

src/concurrency/thread.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use std::task::Poll;
77
use std::time::{Duration, SystemTime};
88

99
use either::Either;
10-
1110
use rustc_const_eval::CTRL_C_RECEIVED;
1211
use rustc_data_structures::fx::FxHashMap;
1312
use rustc_hir::def_id::DefId;

src/concurrency/vector_clock.rs

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1+
use std::cmp::Ordering;
2+
use std::fmt::Debug;
3+
use std::ops::{Index, Shr};
4+
15
use rustc_index::Idx;
26
use rustc_span::{DUMMY_SP, Span, SpanData};
37
use smallvec::SmallVec;
4-
use std::{
5-
cmp::Ordering,
6-
fmt::Debug,
7-
ops::{Index, Shr},
8-
};
98

109
use super::data_race::NaReadType;
1110

@@ -430,10 +429,12 @@ impl Index<VectorIdx> for VClock {
430429
/// test suite
431430
#[cfg(test)]
432431
mod tests {
432+
use std::cmp::Ordering;
433+
434+
use rustc_span::DUMMY_SP;
435+
433436
use super::{VClock, VTimestamp, VectorIdx};
434437
use crate::concurrency::data_race::NaReadType;
435-
use rustc_span::DUMMY_SP;
436-
use std::cmp::Ordering;
437438

438439
#[test]
439440
fn test_equal() {

0 commit comments

Comments
 (0)