Skip to content

Commit ea9f491

Browse files
committed
Reformat use declarations.
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
1 parent b00404e commit ea9f491

14 files changed

+25
-32
lines changed

build_system/abi_cafe.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
use crate::build_sysroot;
21
use crate::path::Dirs;
32
use crate::prepare::GitRepo;
43
use crate::utils::{spawn_and_wait, CargoProject, Compiler};
5-
use crate::{CodegenBackend, SysrootKind};
4+
use crate::{build_sysroot, CodegenBackend, SysrootKind};
65

76
static ABI_CAFE_REPO: GitRepo = GitRepo::github(
87
"Gankra",

build_system/build_sysroot.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
use std::env;
2-
use std::fs;
31
use std::path::{Path, PathBuf};
42
use std::process::Command;
3+
use std::{env, fs};
54

65
use crate::path::{Dirs, RelPath};
76
use crate::rustc_info::get_file_name;

build_system/config.rs

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

43
fn load_config_file() -> Vec<(String, Option<String>)> {
54
fs::read_to_string("config.txt")

build_system/main.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
#![warn(unused_lifetimes)]
33
#![warn(unreachable_pub)]
44

5-
use std::env;
65
use std::path::PathBuf;
7-
use std::process;
6+
use std::{env, process};
87

98
use self::utils::Compiler;
109

build_system/tests.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ use std::fs;
33
use std::path::PathBuf;
44
use std::process::Command;
55

6-
use crate::build_sysroot;
7-
use crate::config;
86
use crate::path::{Dirs, RelPath};
97
use crate::prepare::{apply_patches, GitRepo};
108
use crate::rustc_info::get_default_sysroot;
119
use crate::shared_utils::rustflags_from_env;
1210
use crate::utils::{spawn_and_wait, CargoProject, Compiler, LogGroup};
13-
use crate::{CodegenBackend, SysrootKind};
11+
use crate::{build_sysroot, config, CodegenBackend, SysrootKind};
1412

1513
static BUILD_EXAMPLE_OUT_DIR: RelPath = RelPath::BUILD.join("example");
1614

build_system/utils.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
use std::env;
2-
use std::fs;
3-
use std::io;
41
use std::path::{Path, PathBuf};
52
use std::process::{self, Command};
63
use std::sync::atomic::{AtomicBool, Ordering};
4+
use std::{env, fs, io};
75

86
use crate::path::{Dirs, RelPath};
97
use crate::shared_utils::rustflags_to_cmd_env;

example/alloc_system.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ pub struct System;
88
#[cfg(any(windows, unix, target_os = "redox"))]
99
mod realloc_fallback {
1010
use core::alloc::{GlobalAlloc, Layout};
11-
use core::cmp;
12-
use core::ptr;
11+
use core::{cmp, ptr};
1312
impl super::System {
1413
pub(crate) unsafe fn realloc_fallback(
1514
&self,
@@ -34,6 +33,7 @@ mod platform {
3433
use core::alloc::{GlobalAlloc, Layout};
3534
use core::ffi::c_void;
3635
use core::ptr;
36+
3737
use System;
3838
extern "C" {
3939
fn posix_memalign(memptr: *mut *mut c_void, align: usize, size: usize) -> i32;
@@ -71,6 +71,7 @@ mod platform {
7171
#[allow(nonstandard_style)]
7272
mod platform {
7373
use core::alloc::{GlobalAlloc, Layout};
74+
7475
use System;
7576
type LPVOID = *mut u8;
7677
type HANDLE = LPVOID;

example/arbitrary_self_types_pointers_and_wrappers.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
#![feature(arbitrary_self_types, unsize, coerce_unsized, dispatch_from_dyn)]
44

5-
use std::{
6-
marker::Unsize,
7-
ops::{CoerceUnsized, Deref, DispatchFromDyn},
8-
};
5+
use std::marker::Unsize;
6+
use std::ops::{CoerceUnsized, Deref, DispatchFromDyn};
97

108
struct Ptr<T: ?Sized>(Box<T>);
119

src/debuginfo/unwind.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
//! Unwind info generation (`.eh_frame`)
22
33
use cranelift_codegen::ir::Endianness;
4-
use cranelift_codegen::isa::{unwind::UnwindInfo, TargetIsa};
4+
use cranelift_codegen::isa::unwind::UnwindInfo;
5+
use cranelift_codegen::isa::TargetIsa;
56
use cranelift_object::ObjectProduct;
67
use gimli::write::{CieId, EhFrame, FrameTable, Section};
78
use gimli::RunTimeEndian;

src/driver/aot.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ use rustc_codegen_ssa::assert_module_sources::CguReuse;
1111
use rustc_codegen_ssa::back::link::ensure_removed;
1212
use rustc_codegen_ssa::back::metadata::create_compressed_metadata_file;
1313
use rustc_codegen_ssa::base::determine_cgu_reuse;
14-
use rustc_codegen_ssa::errors as ssa_errors;
15-
use rustc_codegen_ssa::{CodegenResults, CompiledModule, CrateInfo, ModuleKind};
14+
use rustc_codegen_ssa::{
15+
errors as ssa_errors, CodegenResults, CompiledModule, CrateInfo, ModuleKind,
16+
};
1617
use rustc_data_structures::profiling::SelfProfilerRef;
1718
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
1819
use rustc_data_structures::sync::{par_map, IntoDynSyncSend};
@@ -26,8 +27,9 @@ use rustc_session::Session;
2627
use crate::concurrency_limiter::{ConcurrencyLimiter, ConcurrencyLimiterToken};
2728
use crate::debuginfo::TypeDebugContext;
2829
use crate::global_asm::GlobalAsmConfig;
30+
use crate::prelude::*;
2931
use crate::unwind_module::UnwindModule;
30-
use crate::{prelude::*, BackendConfig};
32+
use crate::BackendConfig;
3133

3234
struct ModuleCodegenResult {
3335
module_regular: CompiledModule,

src/driver/jit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ use rustc_session::Session;
1414
use rustc_span::Symbol;
1515

1616
use crate::debuginfo::TypeDebugContext;
17+
use crate::prelude::*;
1718
use crate::unwind_module::UnwindModule;
18-
use crate::{prelude::*, BackendConfig};
19-
use crate::{CodegenCx, CodegenMode};
19+
use crate::{BackendConfig, CodegenCx, CodegenMode};
2020

2121
struct JitState {
2222
jit_module: UnwindModule<JITModule>,

src/lib.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,9 @@ mod vtable;
8585
mod prelude {
8686
pub(crate) use cranelift_codegen::ir::condcodes::{FloatCC, IntCC};
8787
pub(crate) use cranelift_codegen::ir::function::Function;
88-
pub(crate) use cranelift_codegen::ir::types;
8988
pub(crate) use cranelift_codegen::ir::{
90-
AbiParam, Block, FuncRef, Inst, InstBuilder, MemFlags, Signature, SourceLoc, StackSlot,
91-
StackSlotData, StackSlotKind, TrapCode, Type, Value,
89+
types, AbiParam, Block, FuncRef, Inst, InstBuilder, MemFlags, Signature, SourceLoc,
90+
StackSlot, StackSlotData, StackSlotKind, TrapCode, Type, Value,
9291
};
9392
pub(crate) use cranelift_codegen::Context;
9493
pub(crate) use cranelift_module::{self, DataDescription, FuncId, Linkage, Module};

src/main_shim.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext};
22
use rustc_hir::LangItem;
3-
use rustc_middle::ty::AssocKind;
4-
use rustc_middle::ty::GenericArg;
3+
use rustc_middle::ty::{AssocKind, GenericArg};
54
use rustc_session::config::{sigpipe, EntryFnType};
65
use rustc_span::symbol::Ident;
76
use rustc_span::DUMMY_SP;

src/optimize/peephole.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Peephole optimizations that can be performed while creating clif ir.
22
3-
use cranelift_codegen::ir::{condcodes::IntCC, InstructionData, Opcode, Value, ValueDef};
3+
use cranelift_codegen::ir::condcodes::IntCC;
4+
use cranelift_codegen::ir::{InstructionData, Opcode, Value, ValueDef};
45
use cranelift_frontend::FunctionBuilder;
56

67
/// If the given value was produced by the lowering of `Rvalue::Not` return the input and true,

0 commit comments

Comments
 (0)