Skip to content

Commit 5c7a87c

Browse files
authored
Merge pull request rust-lang#1393 from onur-ozkan/rustfmt-group-imports
organize import sections with rustfmt `group_imports`
2 parents 02e5f38 + e048674 commit 5c7a87c

25 files changed

+62
-89
lines changed

src/abi/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@ mod returning;
66

77
use std::borrow::Cow;
88

9+
use cranelift_codegen::ir::{AbiParam, SigRef};
910
use cranelift_module::ModuleError;
1011
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
1112
use rustc_middle::ty::layout::FnAbiOf;
1213
use rustc_session::Session;
1314
use rustc_target::abi::call::{Conv, FnAbi};
1415
use rustc_target::spec::abi::Abi;
1516

16-
use cranelift_codegen::ir::{AbiParam, SigRef};
17-
1817
use self::pass_mode::*;
19-
use crate::prelude::*;
20-
2118
pub(crate) use self::returning::codegen_return;
19+
use crate::prelude::*;
2220

2321
fn clif_sig_from_fn_abi<'tcx>(
2422
tcx: TyCtxt<'tcx>,

src/abi/pass_mode.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
//! Argument passing
22
3-
use crate::prelude::*;
4-
use crate::value_and_place::assert_assignable;
5-
63
use cranelift_codegen::ir::{ArgumentExtension, ArgumentPurpose};
74
use rustc_target::abi::call::{
85
ArgAbi, ArgAttributes, ArgExtension as RustcArgExtension, CastTarget, PassMode, Reg, RegKind,
96
};
107
use smallvec::{smallvec, SmallVec};
118

9+
use crate::prelude::*;
10+
use crate::value_and_place::assert_assignable;
11+
1212
pub(super) trait ArgAbiExt<'tcx> {
1313
fn get_abi_param(&self, tcx: TyCtxt<'tcx>) -> SmallVec<[AbiParam; 2]>;
1414
fn get_abi_return(&self, tcx: TyCtxt<'tcx>) -> (Option<AbiParam>, Vec<AbiParam>);

src/abi/returning.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//! Return value handling
22
3-
use crate::prelude::*;
4-
53
use rustc_target::abi::call::{ArgAbi, PassMode};
64
use smallvec::{smallvec, SmallVec};
75

6+
use crate::prelude::*;
7+
88
/// Return a place where the return value of the current function can be written to. If necessary
99
/// this adds an extra parameter pointing to where the return value needs to be stored.
1010
pub(super) fn codegen_return_param<'tcx>(

src/allocator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
//! Allocator shim
22
// Adapted from rustc
33

4-
use crate::prelude::*;
5-
64
use rustc_ast::expand::allocator::{
75
alloc_error_handler_name, default_fn_name, global_fn_name, AllocatorKind, AllocatorTy,
86
ALLOCATOR_METHODS, NO_ALLOC_SHIM_IS_UNSTABLE,
97
};
108
use rustc_codegen_ssa::base::allocator_kind_for_codegen;
119
use rustc_session::config::OomStrategy;
1210

11+
use crate::prelude::*;
12+
1313
/// Returns whether an allocator shim was created
1414
pub(crate) fn codegen(
1515
tcx: TyCtxt<'_>,

src/analyze.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
//! SSA analysis
22
3-
use crate::prelude::*;
4-
53
use rustc_index::IndexVec;
64
use rustc_middle::mir::StatementKind::*;
75
use rustc_middle::ty::Ty;
86

7+
use crate::prelude::*;
8+
99
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
1010
pub(crate) enum SsaKind {
1111
NotSsa,

src/base.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
//! Codegen of a single function
22
3+
use cranelift_codegen::ir::UserFuncName;
4+
use cranelift_codegen::CodegenError;
5+
use cranelift_module::ModuleError;
36
use rustc_ast::InlineAsmOptions;
47
use rustc_index::IndexVec;
58
use rustc_middle::ty::adjustment::PointerCoercion;
69
use rustc_middle::ty::layout::FnAbiOf;
710
use rustc_middle::ty::print::with_no_trimmed_paths;
811

9-
use cranelift_codegen::ir::UserFuncName;
10-
use cranelift_codegen::CodegenError;
11-
use cranelift_module::ModuleError;
12-
1312
use crate::constant::ConstantCx;
1413
use crate::debuginfo::FunctionDebugContext;
1514
use crate::prelude::*;

src/common.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use cranelift_codegen::isa::TargetFrontendConfig;
22
use gimli::write::FileId;
3-
43
use rustc_data_structures::sync::Lrc;
54
use rustc_index::IndexVec;
65
use rustc_middle::ty::layout::{

src/concurrency_limiter.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
use std::sync::{Arc, Condvar, Mutex};
22

3-
use rustc_session::Session;
4-
53
use jobserver::HelperThread;
4+
use rustc_session::Session;
65

76
// FIXME don't panic when a worker thread panics
87

src/constant.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
//! Handling of `static`s, `const`s and promoted allocations
22
3+
use cranelift_module::*;
34
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
45
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
56
use rustc_middle::mir::interpret::{
67
read_target_uint, AllocId, ConstAllocation, ConstValue, ErrorHandled, GlobalAlloc, Scalar,
78
};
89

9-
use cranelift_module::*;
10-
1110
use crate::prelude::*;
1211

1312
pub(crate) struct ConstantCx {

src/debuginfo/emit.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
//! Write the debuginfo into an object file.
22
33
use cranelift_object::ObjectProduct;
4-
use rustc_data_structures::fx::FxHashMap;
5-
64
use gimli::write::{Address, AttributeValue, EndianVec, Result, Sections, Writer};
75
use gimli::{RunTimeEndian, SectionId};
6+
use rustc_data_structures::fx::FxHashMap;
87

98
use super::object::WriteDebugInfo;
109
use super::DebugContext;

0 commit comments

Comments
 (0)