about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-08-02 11:24:34 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-08-02 11:24:34 +0000
commite47c930f080687bb29478d06fb65d3045207a5c6 (patch)
tree4e081cfe91e75b865e0d80b1acd7bd66a757e79e
parentf340c81caac9bca69fba16a9e6f7622fa099d20a (diff)
parentd35f63e3030b78ced7af2943ada5b419d8ab7cda (diff)
downloadrust-e47c930f080687bb29478d06fb65d3045207a5c6.tar.gz
rust-e47c930f080687bb29478d06fb65d3045207a5c6.zip
Sync from rust 8e86c9567154dc5a9ada15ab196d23eae2bd7d89
-rw-r--r--build_system/abi_cafe.rs3
-rw-r--r--build_system/build_sysroot.rs5
-rw-r--r--build_system/config.rs3
-rw-r--r--build_system/main.rs3
-rw-r--r--build_system/tests.rs4
-rw-r--r--build_system/utils.rs4
-rw-r--r--example/alloc_system.rs5
-rw-r--r--example/arbitrary_self_types_pointers_and_wrappers.rs6
-rw-r--r--example/std_example.rs1
-rw-r--r--rustfmt.toml2
-rw-r--r--src/debuginfo/unwind.rs3
-rw-r--r--src/driver/aot.rs8
-rw-r--r--src/driver/jit.rs4
-rw-r--r--src/lib.rs5
-rw-r--r--src/main_shim.rs3
-rw-r--r--src/optimize/peephole.rs3
16 files changed, 28 insertions, 34 deletions
diff --git a/build_system/abi_cafe.rs b/build_system/abi_cafe.rs
index ecf303c30b6..75f9f233cb3 100644
--- a/build_system/abi_cafe.rs
+++ b/build_system/abi_cafe.rs
@@ -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",
diff --git a/build_system/build_sysroot.rs b/build_system/build_sysroot.rs
index dfbe0f51e7b..ed8b5b906d2 100644
--- a/build_system/build_sysroot.rs
+++ b/build_system/build_sysroot.rs
@@ -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;
@@ -272,7 +271,7 @@ fn build_clif_sysroot_for_triple(
     if channel == "release" {
         build_cmd.arg("--release");
     }
-    build_cmd.arg("--features").arg("backtrace panic-unwind");
+    build_cmd.arg("--features").arg("backtrace panic-unwind compiler-builtins-no-f16-f128");
     build_cmd.env("CARGO_PROFILE_RELEASE_DEBUG", "true");
     build_cmd.env("__CARGO_DEFAULT_LIB_METADATA", "cg_clif");
     if compiler.triple.contains("apple") {
diff --git a/build_system/config.rs b/build_system/config.rs
index c31784e1097..ef540cf1f82 100644
--- a/build_system/config.rs
+++ b/build_system/config.rs
@@ -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")
diff --git a/build_system/main.rs b/build_system/main.rs
index 7dbf608f991..9ddeda583af 100644
--- a/build_system/main.rs
+++ b/build_system/main.rs
@@ -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;
 
diff --git a/build_system/tests.rs b/build_system/tests.rs
index 790d9cbd9fc..afc8a923863 100644
--- a/build_system/tests.rs
+++ b/build_system/tests.rs
@@ -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");
 
diff --git a/build_system/utils.rs b/build_system/utils.rs
index 9f95122b341..3c4b45e02cc 100644
--- a/build_system/utils.rs
+++ b/build_system/utils.rs
@@ -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;
diff --git a/example/alloc_system.rs b/example/alloc_system.rs
index 441f3cd2987..2884c9c32ae 100644
--- a/example/alloc_system.rs
+++ b/example/alloc_system.rs
@@ -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,
@@ -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;
@@ -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;
diff --git a/example/arbitrary_self_types_pointers_and_wrappers.rs b/example/arbitrary_self_types_pointers_and_wrappers.rs
index f7edfa960a2..5479b0c617b 100644
--- a/example/arbitrary_self_types_pointers_and_wrappers.rs
+++ b/example/arbitrary_self_types_pointers_and_wrappers.rs
@@ -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>);
 
diff --git a/example/std_example.rs b/example/std_example.rs
index 6cedd84adfe..e99763e2722 100644
--- a/example/std_example.rs
+++ b/example/std_example.rs
@@ -3,7 +3,6 @@
     coroutines,
     stmt_expr_attributes,
     coroutine_trait,
-    is_sorted,
     repr_simd,
     tuple_trait,
     unboxed_closures
diff --git a/rustfmt.toml b/rustfmt.toml
index 6f4d4413c25..d9e6ac3d543 100644
--- a/rustfmt.toml
+++ b/rustfmt.toml
@@ -6,3 +6,5 @@ ignore = [
 version = "Two"
 use_small_heuristics = "Max"
 merge_derives = false
+group_imports = "StdExternalCrate"
+imports_granularity = "Module"
diff --git a/src/debuginfo/unwind.rs b/src/debuginfo/unwind.rs
index eebd181341d..ac7dd0bd463 100644
--- a/src/debuginfo/unwind.rs
+++ b/src/debuginfo/unwind.rs
@@ -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;
diff --git a/src/driver/aot.rs b/src/driver/aot.rs
index 763d9a48407..b6fee1bf24a 100644
--- a/src/driver/aot.rs
+++ b/src/driver/aot.rs
@@ -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};
@@ -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,
diff --git a/src/driver/jit.rs b/src/driver/jit.rs
index dfee8e714e6..12e860f676d 100644
--- a/src/driver/jit.rs
+++ b/src/driver/jit.rs
@@ -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>,
diff --git a/src/lib.rs b/src/lib.rs
index fab36104845..f737af25b62 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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};
diff --git a/src/main_shim.rs b/src/main_shim.rs
index fe0a1551419..ba20a750d2b 100644
--- a/src/main_shim.rs
+++ b/src/main_shim.rs
@@ -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;
diff --git a/src/optimize/peephole.rs b/src/optimize/peephole.rs
index 26327dca299..c93fe935210 100644
--- a/src/optimize/peephole.rs
+++ b/src/optimize/peephole.rs
@@ -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,