about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-07-29 02:43:41 +0000
committerbors <bors@rust-lang.org>2024-07-29 02:43:41 +0000
commit2e630267b2bce50af3258ce4817e377fa09c145b (patch)
tree29006db815bf547dfd0129910b23b8c54675bd98 /compiler/rustc_errors/src/lib.rs
parent2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b (diff)
parent84ac80f1921afc243d71fd0caaa4f2838c294102 (diff)
downloadrust-2e630267b2bce50af3258ce4817e377fa09c145b.tar.gz
rust-2e630267b2bce50af3258ce4817e377fa09c145b.zip
Auto merge of #125443 - nnethercote:rustfmt-use-decls, r=lcnr,cuviper,GuillaumeGomez
rustfmt `use` declarations

This PR implements https://github.com/rust-lang/compiler-team/issues/750, which changes how `use` declarations are formatted by adding these options to `rustfmt.toml`:
```
group_imports = "StdExternalCrate"
imports_granularity = "Module"
```

r? `@ghost`
Diffstat (limited to 'compiler/rustc_errors/src/lib.rs')
-rw-r--r--compiler/rustc_errors/src/lib.rs45
1 files changed, 21 insertions, 24 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index 2a850d9303c..09855394cdb 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -28,6 +28,17 @@
 
 extern crate self as rustc_errors;
 
+use std::backtrace::{Backtrace, BacktraceStatus};
+use std::borrow::Cow;
+use std::cell::Cell;
+use std::error::Report;
+use std::hash::Hash;
+use std::io::Write;
+use std::num::NonZero;
+use std::ops::DerefMut;
+use std::path::{Path, PathBuf};
+use std::{fmt, panic};
+
 pub use codes::*;
 pub use diagnostic::{
     BugAbort, Diag, DiagArg, DiagArgMap, DiagArgName, DiagArgValue, DiagInner, DiagStyledString,
@@ -39,42 +50,28 @@ pub use diagnostic_impls::{
     IndicateAnonymousLifetime, SingleLabelManySpans,
 };
 pub use emitter::ColorConfig;
+use emitter::{is_case_difference, DynEmitter, Emitter};
+use registry::Registry;
+use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet};
+use rustc_data_structures::stable_hasher::{Hash128, StableHasher};
+use rustc_data_structures::sync::{Lock, Lrc};
+use rustc_data_structures::AtomicRef;
 pub use rustc_error_messages::{
     fallback_fluent_bundle, fluent_bundle, DiagMessage, FluentBundle, LanguageIdentifier,
     LazyFallbackBundle, MultiSpan, SpanLabel, SubdiagMessage,
 };
+use rustc_lint_defs::LintExpectationId;
 pub use rustc_lint_defs::{pluralize, Applicability};
+use rustc_macros::{Decodable, Encodable};
 pub use rustc_span::fatal_error::{FatalError, FatalErrorMarker};
+use rustc_span::source_map::SourceMap;
 pub use rustc_span::ErrorGuaranteed;
+use rustc_span::{Loc, Span, DUMMY_SP};
 pub use snippet::Style;
-
 // Used by external projects such as `rust-gpu`.
 // See https://github.com/rust-lang/rust/pull/115393.
 pub use termcolor::{Color, ColorSpec, WriteColor};
-
-use emitter::{is_case_difference, DynEmitter, Emitter};
-use registry::Registry;
-use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet};
-use rustc_data_structures::stable_hasher::{Hash128, StableHasher};
-use rustc_data_structures::sync::{Lock, Lrc};
-use rustc_data_structures::AtomicRef;
-use rustc_lint_defs::LintExpectationId;
-use rustc_macros::{Decodable, Encodable};
-use rustc_span::source_map::SourceMap;
-use rustc_span::{Loc, Span, DUMMY_SP};
-use std::backtrace::{Backtrace, BacktraceStatus};
-use std::borrow::Cow;
-use std::cell::Cell;
-use std::error::Report;
-use std::fmt;
-use std::hash::Hash;
-use std::io::Write;
-use std::num::NonZero;
-use std::ops::DerefMut;
-use std::panic;
-use std::path::{Path, PathBuf};
 use tracing::debug;
-
 use Level::*;
 
 pub mod annotate_snippet_emitter_writer;