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.
This commit is contained in:
Nicholas Nethercote 2024-07-29 08:13:50 +10:00
parent b00404e1a1
commit ea9f491696
14 changed files with 25 additions and 32 deletions

View File

@ -1,8 +1,7 @@
use crate::build_sysroot;
use crate::path::Dirs; use crate::path::Dirs;
use crate::prepare::GitRepo; use crate::prepare::GitRepo;
use crate::utils::{spawn_and_wait, CargoProject, Compiler}; 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( static ABI_CAFE_REPO: GitRepo = GitRepo::github(
"Gankra", "Gankra",

View File

@ -1,7 +1,6 @@
use std::env;
use std::fs;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::Command; use std::process::Command;
use std::{env, fs};
use crate::path::{Dirs, RelPath}; use crate::path::{Dirs, RelPath};
use crate::rustc_info::get_file_name; use crate::rustc_info::get_file_name;

View File

@ -1,5 +1,4 @@
use std::fs; use std::{fs, process};
use std::process;
fn load_config_file() -> Vec<(String, Option<String>)> { fn load_config_file() -> Vec<(String, Option<String>)> {
fs::read_to_string("config.txt") fs::read_to_string("config.txt")

View File

@ -2,9 +2,8 @@
#![warn(unused_lifetimes)] #![warn(unused_lifetimes)]
#![warn(unreachable_pub)] #![warn(unreachable_pub)]
use std::env;
use std::path::PathBuf; use std::path::PathBuf;
use std::process; use std::{env, process};
use self::utils::Compiler; use self::utils::Compiler;

View File

@ -3,14 +3,12 @@
use std::path::PathBuf; use std::path::PathBuf;
use std::process::Command; use std::process::Command;
use crate::build_sysroot;
use crate::config;
use crate::path::{Dirs, RelPath}; use crate::path::{Dirs, RelPath};
use crate::prepare::{apply_patches, GitRepo}; use crate::prepare::{apply_patches, GitRepo};
use crate::rustc_info::get_default_sysroot; use crate::rustc_info::get_default_sysroot;
use crate::shared_utils::rustflags_from_env; use crate::shared_utils::rustflags_from_env;
use crate::utils::{spawn_and_wait, CargoProject, Compiler, LogGroup}; 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"); static BUILD_EXAMPLE_OUT_DIR: RelPath = RelPath::BUILD.join("example");

View File

@ -1,9 +1,7 @@
use std::env;
use std::fs;
use std::io;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::{self, Command}; use std::process::{self, Command};
use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::atomic::{AtomicBool, Ordering};
use std::{env, fs, io};
use crate::path::{Dirs, RelPath}; use crate::path::{Dirs, RelPath};
use crate::shared_utils::rustflags_to_cmd_env; use crate::shared_utils::rustflags_to_cmd_env;

View File

@ -8,8 +8,7 @@
#[cfg(any(windows, unix, target_os = "redox"))] #[cfg(any(windows, unix, target_os = "redox"))]
mod realloc_fallback { mod realloc_fallback {
use core::alloc::{GlobalAlloc, Layout}; use core::alloc::{GlobalAlloc, Layout};
use core::cmp; use core::{cmp, ptr};
use core::ptr;
impl super::System { impl super::System {
pub(crate) unsafe fn realloc_fallback( pub(crate) unsafe fn realloc_fallback(
&self, &self,
@ -34,6 +33,7 @@ mod platform {
use core::alloc::{GlobalAlloc, Layout}; use core::alloc::{GlobalAlloc, Layout};
use core::ffi::c_void; use core::ffi::c_void;
use core::ptr; use core::ptr;
use System; use System;
extern "C" { extern "C" {
fn posix_memalign(memptr: *mut *mut c_void, align: usize, size: usize) -> i32; fn posix_memalign(memptr: *mut *mut c_void, align: usize, size: usize) -> i32;
@ -71,6 +71,7 @@ unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 {
#[allow(nonstandard_style)] #[allow(nonstandard_style)]
mod platform { mod platform {
use core::alloc::{GlobalAlloc, Layout}; use core::alloc::{GlobalAlloc, Layout};
use System; use System;
type LPVOID = *mut u8; type LPVOID = *mut u8;
type HANDLE = LPVOID; type HANDLE = LPVOID;

View File

@ -2,10 +2,8 @@
#![feature(arbitrary_self_types, unsize, coerce_unsized, dispatch_from_dyn)] #![feature(arbitrary_self_types, unsize, coerce_unsized, dispatch_from_dyn)]
use std::{ use std::marker::Unsize;
marker::Unsize, use std::ops::{CoerceUnsized, Deref, DispatchFromDyn};
ops::{CoerceUnsized, Deref, DispatchFromDyn},
};
struct Ptr<T: ?Sized>(Box<T>); struct Ptr<T: ?Sized>(Box<T>);

View File

@ -1,7 +1,8 @@
//! Unwind info generation (`.eh_frame`) //! Unwind info generation (`.eh_frame`)
use cranelift_codegen::ir::Endianness; 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 cranelift_object::ObjectProduct;
use gimli::write::{CieId, EhFrame, FrameTable, Section}; use gimli::write::{CieId, EhFrame, FrameTable, Section};
use gimli::RunTimeEndian; use gimli::RunTimeEndian;

View File

@ -11,8 +11,9 @@
use rustc_codegen_ssa::back::link::ensure_removed; use rustc_codegen_ssa::back::link::ensure_removed;
use rustc_codegen_ssa::back::metadata::create_compressed_metadata_file; use rustc_codegen_ssa::back::metadata::create_compressed_metadata_file;
use rustc_codegen_ssa::base::determine_cgu_reuse; use rustc_codegen_ssa::base::determine_cgu_reuse;
use rustc_codegen_ssa::errors as ssa_errors; use rustc_codegen_ssa::{
use rustc_codegen_ssa::{CodegenResults, CompiledModule, CrateInfo, ModuleKind}; errors as ssa_errors, CodegenResults, CompiledModule, CrateInfo, ModuleKind,
};
use rustc_data_structures::profiling::SelfProfilerRef; use rustc_data_structures::profiling::SelfProfilerRef;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::sync::{par_map, IntoDynSyncSend}; use rustc_data_structures::sync::{par_map, IntoDynSyncSend};
@ -26,8 +27,9 @@
use crate::concurrency_limiter::{ConcurrencyLimiter, ConcurrencyLimiterToken}; use crate::concurrency_limiter::{ConcurrencyLimiter, ConcurrencyLimiterToken};
use crate::debuginfo::TypeDebugContext; use crate::debuginfo::TypeDebugContext;
use crate::global_asm::GlobalAsmConfig; use crate::global_asm::GlobalAsmConfig;
use crate::prelude::*;
use crate::unwind_module::UnwindModule; use crate::unwind_module::UnwindModule;
use crate::{prelude::*, BackendConfig}; use crate::BackendConfig;
struct ModuleCodegenResult { struct ModuleCodegenResult {
module_regular: CompiledModule, module_regular: CompiledModule,

View File

@ -14,9 +14,9 @@
use rustc_span::Symbol; use rustc_span::Symbol;
use crate::debuginfo::TypeDebugContext; use crate::debuginfo::TypeDebugContext;
use crate::prelude::*;
use crate::unwind_module::UnwindModule; use crate::unwind_module::UnwindModule;
use crate::{prelude::*, BackendConfig}; use crate::{BackendConfig, CodegenCx, CodegenMode};
use crate::{CodegenCx, CodegenMode};
struct JitState { struct JitState {
jit_module: UnwindModule<JITModule>, jit_module: UnwindModule<JITModule>,

View File

@ -85,10 +85,9 @@
mod prelude { mod prelude {
pub(crate) use cranelift_codegen::ir::condcodes::{FloatCC, IntCC}; pub(crate) use cranelift_codegen::ir::condcodes::{FloatCC, IntCC};
pub(crate) use cranelift_codegen::ir::function::Function; pub(crate) use cranelift_codegen::ir::function::Function;
pub(crate) use cranelift_codegen::ir::types;
pub(crate) use cranelift_codegen::ir::{ pub(crate) use cranelift_codegen::ir::{
AbiParam, Block, FuncRef, Inst, InstBuilder, MemFlags, Signature, SourceLoc, StackSlot, types, AbiParam, Block, FuncRef, Inst, InstBuilder, MemFlags, Signature, SourceLoc,
StackSlotData, StackSlotKind, TrapCode, Type, Value, StackSlot, StackSlotData, StackSlotKind, TrapCode, Type, Value,
}; };
pub(crate) use cranelift_codegen::Context; pub(crate) use cranelift_codegen::Context;
pub(crate) use cranelift_module::{self, DataDescription, FuncId, Linkage, Module}; pub(crate) use cranelift_module::{self, DataDescription, FuncId, Linkage, Module};

View File

@ -1,7 +1,6 @@
use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext}; use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext};
use rustc_hir::LangItem; use rustc_hir::LangItem;
use rustc_middle::ty::AssocKind; use rustc_middle::ty::{AssocKind, GenericArg};
use rustc_middle::ty::GenericArg;
use rustc_session::config::{sigpipe, EntryFnType}; use rustc_session::config::{sigpipe, EntryFnType};
use rustc_span::symbol::Ident; use rustc_span::symbol::Ident;
use rustc_span::DUMMY_SP; use rustc_span::DUMMY_SP;

View File

@ -1,6 +1,7 @@
//! Peephole optimizations that can be performed while creating clif ir. //! 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; use cranelift_frontend::FunctionBuilder;
/// If the given value was produced by the lowering of `Rvalue::Not` return the input and true, /// If the given value was produced by the lowering of `Rvalue::Not` return the input and true,