Skip to content

Commit

Permalink
Reformat use declarations.
Browse files Browse the repository at this point in the history
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
  • Loading branch information
nnethercote committed Jul 28, 2024
1 parent b00404e commit ea9f491
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 32 deletions.
3 changes: 1 addition & 2 deletions build_system/abi_cafe.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crate::build_sysroot;
use crate::path::Dirs;
use crate::prepare::GitRepo;
use crate::utils::{spawn_and_wait, CargoProject, Compiler};
use crate::{CodegenBackend, SysrootKind};
use crate::{build_sysroot, CodegenBackend, SysrootKind};

static ABI_CAFE_REPO: GitRepo = GitRepo::github(
"Gankra",
Expand Down
3 changes: 1 addition & 2 deletions build_system/build_sysroot.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::env;
use std::fs;
use std::path::{Path, PathBuf};
use std::process::Command;
use std::{env, fs};

use crate::path::{Dirs, RelPath};
use crate::rustc_info::get_file_name;
Expand Down
3 changes: 1 addition & 2 deletions build_system/config.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::fs;
use std::process;
use std::{fs, process};

fn load_config_file() -> Vec<(String, Option<String>)> {
fs::read_to_string("config.txt")
Expand Down
3 changes: 1 addition & 2 deletions build_system/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
#![warn(unused_lifetimes)]
#![warn(unreachable_pub)]

use std::env;
use std::path::PathBuf;
use std::process;
use std::{env, process};

use self::utils::Compiler;

Expand Down
4 changes: 1 addition & 3 deletions build_system/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ use std::fs;
use std::path::PathBuf;
use std::process::Command;

use crate::build_sysroot;
use crate::config;
use crate::path::{Dirs, RelPath};
use crate::prepare::{apply_patches, GitRepo};
use crate::rustc_info::get_default_sysroot;
use crate::shared_utils::rustflags_from_env;
use crate::utils::{spawn_and_wait, CargoProject, Compiler, LogGroup};
use crate::{CodegenBackend, SysrootKind};
use crate::{build_sysroot, config, CodegenBackend, SysrootKind};

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

Expand Down
4 changes: 1 addition & 3 deletions build_system/utils.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use std::env;
use std::fs;
use std::io;
use std::path::{Path, PathBuf};
use std::process::{self, Command};
use std::sync::atomic::{AtomicBool, Ordering};
use std::{env, fs, io};

use crate::path::{Dirs, RelPath};
use crate::shared_utils::rustflags_to_cmd_env;
Expand Down
5 changes: 3 additions & 2 deletions example/alloc_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ pub struct System;
#[cfg(any(windows, unix, target_os = "redox"))]
mod realloc_fallback {
use core::alloc::{GlobalAlloc, Layout};
use core::cmp;
use core::ptr;
use core::{cmp, ptr};
impl super::System {
pub(crate) unsafe fn realloc_fallback(
&self,
Expand All @@ -34,6 +33,7 @@ mod platform {
use core::alloc::{GlobalAlloc, Layout};
use core::ffi::c_void;
use core::ptr;

use System;
extern "C" {
fn posix_memalign(memptr: *mut *mut c_void, align: usize, size: usize) -> i32;
Expand Down Expand Up @@ -71,6 +71,7 @@ mod platform {
#[allow(nonstandard_style)]
mod platform {
use core::alloc::{GlobalAlloc, Layout};

use System;
type LPVOID = *mut u8;
type HANDLE = LPVOID;
Expand Down
6 changes: 2 additions & 4 deletions example/arbitrary_self_types_pointers_and_wrappers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

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

use std::{
marker::Unsize,
ops::{CoerceUnsized, Deref, DispatchFromDyn},
};
use std::marker::Unsize;
use std::ops::{CoerceUnsized, Deref, DispatchFromDyn};

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

Expand Down
3 changes: 2 additions & 1 deletion src/debuginfo/unwind.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
//! Unwind info generation (`.eh_frame`)

use cranelift_codegen::ir::Endianness;
use cranelift_codegen::isa::{unwind::UnwindInfo, TargetIsa};
use cranelift_codegen::isa::unwind::UnwindInfo;
use cranelift_codegen::isa::TargetIsa;
use cranelift_object::ObjectProduct;
use gimli::write::{CieId, EhFrame, FrameTable, Section};
use gimli::RunTimeEndian;
Expand Down
8 changes: 5 additions & 3 deletions src/driver/aot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ use rustc_codegen_ssa::assert_module_sources::CguReuse;
use rustc_codegen_ssa::back::link::ensure_removed;
use rustc_codegen_ssa::back::metadata::create_compressed_metadata_file;
use rustc_codegen_ssa::base::determine_cgu_reuse;
use rustc_codegen_ssa::errors as ssa_errors;
use rustc_codegen_ssa::{CodegenResults, CompiledModule, CrateInfo, ModuleKind};
use rustc_codegen_ssa::{
errors as ssa_errors, CodegenResults, CompiledModule, CrateInfo, ModuleKind,
};
use rustc_data_structures::profiling::SelfProfilerRef;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::sync::{par_map, IntoDynSyncSend};
Expand All @@ -26,8 +27,9 @@ use rustc_session::Session;
use crate::concurrency_limiter::{ConcurrencyLimiter, ConcurrencyLimiterToken};
use crate::debuginfo::TypeDebugContext;
use crate::global_asm::GlobalAsmConfig;
use crate::prelude::*;
use crate::unwind_module::UnwindModule;
use crate::{prelude::*, BackendConfig};
use crate::BackendConfig;

struct ModuleCodegenResult {
module_regular: CompiledModule,
Expand Down
4 changes: 2 additions & 2 deletions src/driver/jit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ use rustc_session::Session;
use rustc_span::Symbol;

use crate::debuginfo::TypeDebugContext;
use crate::prelude::*;
use crate::unwind_module::UnwindModule;
use crate::{prelude::*, BackendConfig};
use crate::{CodegenCx, CodegenMode};
use crate::{BackendConfig, CodegenCx, CodegenMode};

struct JitState {
jit_module: UnwindModule<JITModule>,
Expand Down
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,9 @@ mod vtable;
mod prelude {
pub(crate) use cranelift_codegen::ir::condcodes::{FloatCC, IntCC};
pub(crate) use cranelift_codegen::ir::function::Function;
pub(crate) use cranelift_codegen::ir::types;
pub(crate) use cranelift_codegen::ir::{
AbiParam, Block, FuncRef, Inst, InstBuilder, MemFlags, Signature, SourceLoc, StackSlot,
StackSlotData, StackSlotKind, TrapCode, Type, Value,
types, AbiParam, Block, FuncRef, Inst, InstBuilder, MemFlags, Signature, SourceLoc,
StackSlot, StackSlotData, StackSlotKind, TrapCode, Type, Value,
};
pub(crate) use cranelift_codegen::Context;
pub(crate) use cranelift_module::{self, DataDescription, FuncId, Linkage, Module};
Expand Down
3 changes: 1 addition & 2 deletions src/main_shim.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext};
use rustc_hir::LangItem;
use rustc_middle::ty::AssocKind;
use rustc_middle::ty::GenericArg;
use rustc_middle::ty::{AssocKind, GenericArg};
use rustc_session::config::{sigpipe, EntryFnType};
use rustc_span::symbol::Ident;
use rustc_span::DUMMY_SP;
Expand Down
3 changes: 2 additions & 1 deletion src/optimize/peephole.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Peephole optimizations that can be performed while creating clif ir.

use cranelift_codegen::ir::{condcodes::IntCC, InstructionData, Opcode, Value, ValueDef};
use cranelift_codegen::ir::condcodes::IntCC;
use cranelift_codegen::ir::{InstructionData, Opcode, Value, ValueDef};
use cranelift_frontend::FunctionBuilder;

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

0 comments on commit ea9f491

Please sign in to comment.