about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/attr_wrapper.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_parse/src/parser/attr_wrapper.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_parse/src/parser/attr_wrapper.rs')
-rw-r--r--compiler/rustc_parse/src/parser/attr_wrapper.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/compiler/rustc_parse/src/parser/attr_wrapper.rs b/compiler/rustc_parse/src/parser/attr_wrapper.rs
index 5dc49ea51d1..611dbc0535c 100644
--- a/compiler/rustc_parse/src/parser/attr_wrapper.rs
+++ b/compiler/rustc_parse/src/parser/attr_wrapper.rs
@@ -1,14 +1,16 @@
-use super::{Capturing, FlatToken, ForceCollect, Parser, ReplaceRange, TokenCursor};
+use std::{iter, mem};
+
 use rustc_ast::token::{Delimiter, Token, TokenKind};
-use rustc_ast::tokenstream::{AttrTokenStream, AttrTokenTree, AttrsTarget, DelimSpacing};
-use rustc_ast::tokenstream::{DelimSpan, LazyAttrTokenStream, Spacing, ToAttrTokenStream};
-use rustc_ast::{self as ast};
-use rustc_ast::{AttrVec, Attribute, HasAttrs, HasTokens};
+use rustc_ast::tokenstream::{
+    AttrTokenStream, AttrTokenTree, AttrsTarget, DelimSpacing, DelimSpan, LazyAttrTokenStream,
+    Spacing, ToAttrTokenStream,
+};
+use rustc_ast::{self as ast, AttrVec, Attribute, HasAttrs, HasTokens};
 use rustc_errors::PResult;
 use rustc_session::parse::ParseSess;
 use rustc_span::{sym, Span, DUMMY_SP};
 
-use std::{iter, mem};
+use super::{Capturing, FlatToken, ForceCollect, Parser, ReplaceRange, TokenCursor};
 
 /// A wrapper type to ensure that the parser handles outer attributes correctly.
 /// When we parse outer attributes, we need to ensure that we capture tokens
@@ -469,8 +471,9 @@ fn needs_tokens(attrs: &[ast::Attribute]) -> bool {
 // Some types are used a lot. Make sure they don't unintentionally get bigger.
 #[cfg(target_pointer_width = "64")]
 mod size_asserts {
-    use super::*;
     use rustc_data_structures::static_assert_size;
+
+    use super::*;
     // tidy-alphabetical-start
     static_assert_size!(AttrWrapper, 16);
     static_assert_size!(LazyAttrTokenStreamImpl, 96);