From eb093cfd5d2065f9ff0b63f7fa30261cb9717e2c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 5 Mar 2026 14:58:41 -0800 Subject: [PATCH] Reformat with the new stage0 --- compiler/rustc_ast_lowering/src/delegation.rs | 3 ++- compiler/rustc_builtin_macros/src/asm.rs | 3 ++- compiler/rustc_driver_impl/src/pretty.rs | 3 ++- compiler/rustc_expand/src/proc_macro.rs | 3 ++- compiler/rustc_hir_analysis/src/check/wfcheck.rs | 3 ++- compiler/rustc_hir_pretty/src/lib.rs | 3 ++- compiler/rustc_hir_typeck/src/expr.rs | 3 ++- compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs | 3 ++- compiler/rustc_hir_typeck/src/op.rs | 3 ++- compiler/rustc_hir_typeck/src/place_op.rs | 3 ++- .../rustc_incremental/src/assert_dep_graph.rs | 3 ++- compiler/rustc_lint/src/context.rs | 3 ++- compiler/rustc_lint/src/internal.rs | 3 ++- compiler/rustc_lint/src/levels.rs | 3 ++- compiler/rustc_lint/src/nonstandard_style.rs | 3 ++- compiler/rustc_lint/src/types.rs | 3 ++- compiler/rustc_lint/src/types/literal.rs | 3 ++- compiler/rustc_metadata/src/rmeta/mod.rs | 3 ++- compiler/rustc_middle/src/ich/impls_syntax.rs | 3 ++- compiler/rustc_middle/src/queries.rs | 4 +++- compiler/rustc_middle/src/ty/layout.rs | 3 ++- compiler/rustc_middle/src/ty/mod.rs | 3 ++- compiler/rustc_public/src/ty.rs | 3 ++- compiler/rustc_ty_utils/src/layout.rs | 3 ++- library/alloctests/tests/slice.rs | 3 ++- src/librustdoc/clean/types.rs | 3 ++- src/librustdoc/clean/utils.rs | 3 ++- src/tools/run-make-support/src/lib.rs | 13 ++++++++++--- tests/codegen-llvm/reg-struct-return.rs | 15 +++++++++++---- .../thumb-none-qemu/example/src/main.rs | 3 ++- 30 files changed, 78 insertions(+), 35 deletions(-) diff --git a/compiler/rustc_ast_lowering/src/delegation.rs b/compiler/rustc_ast_lowering/src/delegation.rs index 1d634c03255e..004eb384c24a 100644 --- a/compiler/rustc_ast_lowering/src/delegation.rs +++ b/compiler/rustc_ast_lowering/src/delegation.rs @@ -42,10 +42,12 @@ use ast::visit::Visitor; use hir::def::{DefKind, PartialRes, Res}; use hir::{BodyId, HirId}; use rustc_abi::ExternAbi; +use rustc_ast as ast; use rustc_ast::*; use rustc_attr_parsing::{AttributeParser, ShouldEmit}; use rustc_data_structures::fx::FxHashSet; use rustc_errors::ErrorGuaranteed; +use rustc_hir as hir; use rustc_hir::attrs::{AttributeKind, InlineAttr}; use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_middle::span_bug; @@ -53,7 +55,6 @@ use rustc_middle::ty::{Asyncness, DelegationAttrs, DelegationFnSigAttrs, Resolve use rustc_span::symbol::kw; use rustc_span::{DUMMY_SP, Ident, Span, Symbol}; use smallvec::SmallVec; -use {rustc_ast as ast, rustc_hir as hir}; use crate::delegation::generics::{GenericsGenerationResult, GenericsGenerationResults}; use crate::errors::{CycleInDelegationSignatureResolution, UnresolvedDelegationCallee}; diff --git a/compiler/rustc_builtin_macros/src/asm.rs b/compiler/rustc_builtin_macros/src/asm.rs index 62a39d957b9c..a1e14b524513 100644 --- a/compiler/rustc_builtin_macros/src/asm.rs +++ b/compiler/rustc_builtin_macros/src/asm.rs @@ -1,3 +1,4 @@ +use rustc_ast as ast; use rustc_ast::tokenstream::TokenStream; use rustc_ast::{AsmMacro, token}; use rustc_data_structures::fx::{FxHashMap, FxIndexMap}; @@ -5,11 +6,11 @@ use rustc_errors::PResult; use rustc_expand::base::*; use rustc_index::bit_set::GrowableBitSet; use rustc_parse::parser::asm::*; +use rustc_parse_format as parse; use rustc_session::lint; use rustc_span::{ErrorGuaranteed, InnerSpan, Span, Symbol, sym}; use rustc_target::asm::InlineAsmArch; use smallvec::smallvec; -use {rustc_ast as ast, rustc_parse_format as parse}; use crate::errors; use crate::util::{ExprToSpannedString, expr_to_spanned_string}; diff --git a/compiler/rustc_driver_impl/src/pretty.rs b/compiler/rustc_driver_impl/src/pretty.rs index 962d035db862..79b6fc59978f 100644 --- a/compiler/rustc_driver_impl/src/pretty.rs +++ b/compiler/rustc_driver_impl/src/pretty.rs @@ -3,7 +3,9 @@ use std::cell::Cell; use std::fmt::Write; +use rustc_ast as ast; use rustc_ast_pretty::pprust as pprust_ast; +use rustc_hir_pretty as pprust_hir; use rustc_middle::bug; use rustc_middle::mir::{write_mir_graphviz, write_mir_pretty}; use rustc_middle::ty::{self, TyCtxt}; @@ -13,7 +15,6 @@ use rustc_session::Session; use rustc_session::config::{OutFileName, PpHirMode, PpMode, PpSourceMode}; use rustc_span::{FileName, Ident}; use tracing::debug; -use {rustc_ast as ast, rustc_hir_pretty as pprust_hir}; pub use self::PpMode::*; pub use self::PpSourceMode::*; diff --git a/compiler/rustc_expand/src/proc_macro.rs b/compiler/rustc_expand/src/proc_macro.rs index a892b21d7622..5b2482f5c1db 100644 --- a/compiler/rustc_expand/src/proc_macro.rs +++ b/compiler/rustc_expand/src/proc_macro.rs @@ -1,12 +1,13 @@ +use rustc_ast as ast; use rustc_ast::tokenstream::TokenStream; use rustc_errors::ErrorGuaranteed; use rustc_middle::ty::{self, TyCtxt}; use rustc_parse::parser::{AllowConstBlockItems, ForceCollect, Parser}; +use rustc_proc_macro as pm; use rustc_session::Session; use rustc_session::config::ProcMacroExecutionStrategy; use rustc_span::profiling::SpannedEventArgRecorder; use rustc_span::{LocalExpnId, Span}; -use {rustc_ast as ast, rustc_proc_macro as pm}; use crate::base::{self, *}; use crate::{errors, proc_macro_server}; diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs index 38025f74b2f6..155f68cf38be 100644 --- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs +++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs @@ -3,9 +3,11 @@ use std::ops::{ControlFlow, Deref}; use hir::intravisit::{self, Visitor}; use rustc_abi::{ExternAbi, ScalableElt}; +use rustc_ast as ast; use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet}; use rustc_errors::codes::*; use rustc_errors::{Applicability, ErrorGuaranteed, msg, pluralize, struct_span_code_err}; +use rustc_hir as hir; use rustc_hir::attrs::{EiiDecl, EiiImpl, EiiImplResolution}; use rustc_hir::def::{DefKind, Res}; use rustc_hir::def_id::{DefId, LocalDefId}; @@ -37,7 +39,6 @@ use rustc_trait_selection::traits::{ WellFormedLoc, }; use tracing::{debug, instrument}; -use {rustc_ast as ast, rustc_hir as hir}; use super::compare_eii::compare_eii_function_types; use crate::autoderef::Autoderef; diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs index 369c7c077474..e806d72d3dd2 100644 --- a/compiler/rustc_hir_pretty/src/lib.rs +++ b/compiler/rustc_hir_pretty/src/lib.rs @@ -9,12 +9,14 @@ use std::cell::Cell; use std::vec; use rustc_abi::ExternAbi; +use rustc_ast as ast; use rustc_ast::util::parser::{self, ExprPrecedence, Fixity}; use rustc_ast::{DUMMY_NODE_ID, DelimArgs}; use rustc_ast_pretty::pp::Breaks::{Consistent, Inconsistent}; use rustc_ast_pretty::pp::{self, BoxMarker, Breaks}; use rustc_ast_pretty::pprust::state::MacHeader; use rustc_ast_pretty::pprust::{Comments, PrintState}; +use rustc_hir as hir; use rustc_hir::attrs::{AttributeKind, PrintAttribute}; use rustc_hir::{ BindingMode, ByRef, ConstArg, ConstArgExprField, ConstArgKind, GenericArg, GenericBound, @@ -23,7 +25,6 @@ use rustc_hir::{ }; use rustc_span::source_map::{SourceMap, Spanned}; use rustc_span::{DUMMY_SP, FileName, Ident, Span, Symbol, kw, sym}; -use {rustc_ast as ast, rustc_hir as hir}; pub fn id_to_string(cx: &dyn rustc_hir::intravisit::HirTyCtxt<'_>, hir_id: HirId) -> String { to_string(&cx, |s| s.print_node(cx.hir_node(hir_id))) diff --git a/compiler/rustc_hir_typeck/src/expr.rs b/compiler/rustc_hir_typeck/src/expr.rs index b20579231cdd..2de101a1e452 100644 --- a/compiler/rustc_hir_typeck/src/expr.rs +++ b/compiler/rustc_hir_typeck/src/expr.rs @@ -6,6 +6,7 @@ //! See [`rustc_hir_analysis::check`] for more context on type checking in general. use rustc_abi::{FIRST_VARIANT, FieldIdx}; +use rustc_ast as ast; use rustc_ast::util::parser::ExprPrecedence; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::stack::ensure_sufficient_stack; @@ -15,6 +16,7 @@ use rustc_errors::{ Applicability, Diag, ErrorGuaranteed, MultiSpan, StashKey, Subdiagnostic, listify, pluralize, struct_span_code_err, }; +use rustc_hir as hir; use rustc_hir::def::{CtorKind, DefKind, Res}; use rustc_hir::def_id::DefId; use rustc_hir::lang_items::LangItem; @@ -37,7 +39,6 @@ use rustc_span::{Ident, Span, Symbol, kw, sym}; use rustc_trait_selection::infer::InferCtxtExt; use rustc_trait_selection::traits::{self, ObligationCauseCode, ObligationCtxt}; use tracing::{debug, instrument, trace}; -use {rustc_ast as ast, rustc_hir as hir}; use crate::Expectation::{self, ExpectCastableToType, ExpectHasType, NoExpectation}; use crate::coercion::CoerceMany; diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs index 967f255361b5..9faa75e18480 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs @@ -2,9 +2,11 @@ use std::ops::Deref; use std::{fmt, iter}; use itertools::Itertools; +use rustc_ast as ast; use rustc_data_structures::fx::FxIndexSet; use rustc_errors::codes::*; use rustc_errors::{Applicability, Diag, ErrorGuaranteed, MultiSpan, a_or_an, listify, pluralize}; +use rustc_hir as hir; use rustc_hir::attrs::DivergingBlockBehavior; use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res}; use rustc_hir::def_id::DefId; @@ -25,7 +27,6 @@ use rustc_trait_selection::infer::InferCtxtExt; use rustc_trait_selection::traits::{self, ObligationCauseCode, ObligationCtxt, SelectionContext}; use smallvec::SmallVec; use tracing::debug; -use {rustc_ast as ast, rustc_hir as hir}; use crate::Expectation::*; use crate::TupleArgumentsFlag::*; diff --git a/compiler/rustc_hir_typeck/src/op.rs b/compiler/rustc_hir_typeck/src/op.rs index e9d79a2ece2e..4b325a7ad14a 100644 --- a/compiler/rustc_hir_typeck/src/op.rs +++ b/compiler/rustc_hir_typeck/src/op.rs @@ -1,8 +1,10 @@ //! Code related to processing overloaded binary and unary operators. +use rustc_ast as ast; use rustc_data_structures::packed::Pu128; use rustc_errors::codes::*; use rustc_errors::{Applicability, Diag, struct_span_code_err}; +use rustc_hir as hir; use rustc_infer::traits::ObligationCauseCode; use rustc_middle::bug; use rustc_middle::ty::adjustment::{ @@ -16,7 +18,6 @@ use rustc_span::{Span, Symbol, sym}; use rustc_trait_selection::infer::InferCtxtExt; use rustc_trait_selection::traits::{FulfillmentError, Obligation, ObligationCtxt}; use tracing::debug; -use {rustc_ast as ast, rustc_hir as hir}; use super::FnCtxt; use super::method::MethodCallee; diff --git a/compiler/rustc_hir_typeck/src/place_op.rs b/compiler/rustc_hir_typeck/src/place_op.rs index c33f8bdaffe2..b3ac237adf95 100644 --- a/compiler/rustc_hir_typeck/src/place_op.rs +++ b/compiler/rustc_hir_typeck/src/place_op.rs @@ -1,4 +1,6 @@ +use rustc_ast as ast; use rustc_errors::Applicability; +use rustc_hir as hir; use rustc_hir_analysis::autoderef::Autoderef; use rustc_infer::infer::InferOk; use rustc_infer::traits::{Obligation, ObligationCauseCode}; @@ -10,7 +12,6 @@ use rustc_middle::ty::adjustment::{ use rustc_middle::ty::{self, Ty}; use rustc_span::{Span, sym}; use tracing::debug; -use {rustc_ast as ast, rustc_hir as hir}; use crate::method::{MethodCallee, TreatNotYetDefinedOpaques}; use crate::{FnCtxt, PlaceOp}; diff --git a/compiler/rustc_incremental/src/assert_dep_graph.rs b/compiler/rustc_incremental/src/assert_dep_graph.rs index 93e6c084a191..61ddd2ca566b 100644 --- a/compiler/rustc_incremental/src/assert_dep_graph.rs +++ b/compiler/rustc_incremental/src/assert_dep_graph.rs @@ -39,6 +39,8 @@ use std::io::Write; use rustc_data_structures::fx::FxIndexSet; use rustc_data_structures::graph::linked_graph::{Direction, INCOMING, NodeIndex, OUTGOING}; +use rustc_graphviz as dot; +use rustc_hir as hir; use rustc_hir::Attribute; use rustc_hir::attrs::AttributeKind; use rustc_hir::def_id::{CRATE_DEF_ID, DefId, LocalDefId}; @@ -49,7 +51,6 @@ use rustc_middle::hir::nested_filter; use rustc_middle::ty::TyCtxt; use rustc_span::{Span, Symbol, sym}; use tracing::debug; -use {rustc_graphviz as dot, rustc_hir as hir}; use crate::errors; diff --git a/compiler/rustc_lint/src/context.rs b/compiler/rustc_lint/src/context.rs index 98f087892a39..d7a0a02f085a 100644 --- a/compiler/rustc_lint/src/context.rs +++ b/compiler/rustc_lint/src/context.rs @@ -6,6 +6,7 @@ use std::cell::Cell; use std::slice; +use rustc_abi as abi; use rustc_ast::BindingMode; use rustc_ast::util::parser::ExprPrecedence; use rustc_data_structures::fx::FxIndexMap; @@ -13,6 +14,7 @@ use rustc_data_structures::sync; use rustc_data_structures::unord::UnordMap; use rustc_errors::{Diagnostic, LintBuffer, MultiSpan}; use rustc_feature::Features; +use rustc_hir as hir; use rustc_hir::def::Res; use rustc_hir::def_id::{CrateNum, DefId}; use rustc_hir::definitions::{DefPathData, DisambiguatedDefPathData}; @@ -28,7 +30,6 @@ use rustc_session::{DynLintStore, Session}; use rustc_span::edit_distance::find_best_match_for_names; use rustc_span::{Ident, Span, Symbol, sym}; use tracing::debug; -use {rustc_abi as abi, rustc_hir as hir}; use self::TargetLint::*; use crate::levels::LintLevelsBuilder; diff --git a/compiler/rustc_lint/src/internal.rs b/compiler/rustc_lint/src/internal.rs index cb4c5077a526..357aa94feb1e 100644 --- a/compiler/rustc_lint/src/internal.rs +++ b/compiler/rustc_lint/src/internal.rs @@ -1,7 +1,9 @@ //! Some lints that are only useful in the compiler or crates that use compiler internals, such as //! Clippy. +use rustc_ast as ast; use rustc_ast::{Pat, PatKind, Path}; +use rustc_hir as hir; use rustc_hir::def::Res; use rustc_hir::def_id::DefId; use rustc_hir::{Expr, ExprKind, HirId, find_attr}; @@ -9,7 +11,6 @@ use rustc_middle::ty::{self, GenericArgsRef, PredicatePolarity}; use rustc_session::{declare_lint_pass, declare_tool_lint}; use rustc_span::hygiene::{ExpnKind, MacroKind}; use rustc_span::{Span, sym}; -use {rustc_ast as ast, rustc_hir as hir}; use crate::lints::{ AttributeKindInFindAttr, BadOptAccessDiag, DefaultHashTypesDiag, diff --git a/compiler/rustc_lint/src/levels.rs b/compiler/rustc_lint/src/levels.rs index 8b7a8c9ed5d8..6f3a7e945d93 100644 --- a/compiler/rustc_lint/src/levels.rs +++ b/compiler/rustc_lint/src/levels.rs @@ -1,9 +1,11 @@ +use rustc_ast as ast; use rustc_ast::attr::AttributeExt; use rustc_ast_pretty::pprust; use rustc_data_structures::fx::{FxHashSet, FxIndexMap}; use rustc_data_structures::unord::UnordSet; use rustc_errors::{Diag, DiagCtxtHandle, Diagnostic, MultiSpan, msg}; use rustc_feature::{Features, GateIssue}; +use rustc_hir as hir; use rustc_hir::HirId; use rustc_hir::intravisit::{self, Visitor}; use rustc_index::IndexVec; @@ -23,7 +25,6 @@ use rustc_session::lint::builtin::{ use rustc_session::lint::{Level, Lint, LintExpectationId, LintId}; use rustc_span::{DUMMY_SP, Span, Symbol, sym}; use tracing::{debug, instrument}; -use {rustc_ast as ast, rustc_hir as hir}; use crate::builtin::MISSING_DOCS; use crate::context::{CheckLintNameResult, LintStore}; diff --git a/compiler/rustc_lint/src/nonstandard_style.rs b/compiler/rustc_lint/src/nonstandard_style.rs index b42966ce8ec8..1fd6699e2506 100644 --- a/compiler/rustc_lint/src/nonstandard_style.rs +++ b/compiler/rustc_lint/src/nonstandard_style.rs @@ -1,6 +1,8 @@ use rustc_abi::ExternAbi; +use rustc_ast as ast; use rustc_attr_parsing::AttributeParser; use rustc_errors::{Applicability, Diag, DiagCtxtHandle, Diagnostic, Level}; +use rustc_hir as hir; use rustc_hir::attrs::{AttributeKind, ReprAttr}; use rustc_hir::def::{DefKind, Res}; use rustc_hir::def_id::DefId; @@ -12,7 +14,6 @@ use rustc_session::config::CrateType; use rustc_session::{declare_lint, declare_lint_pass}; use rustc_span::def_id::LocalDefId; use rustc_span::{BytePos, Ident, Span, sym}; -use {rustc_ast as ast, rustc_hir as hir}; use crate::lints::{ NonCamelCaseType, NonCamelCaseTypeSub, NonSnakeCaseDiag, NonSnakeCaseDiagSub, diff --git a/compiler/rustc_lint/src/types.rs b/compiler/rustc_lint/src/types.rs index 6f9795db17eb..2daf2a150354 100644 --- a/compiler/rustc_lint/src/types.rs +++ b/compiler/rustc_lint/src/types.rs @@ -1,6 +1,8 @@ use std::iter; use rustc_abi::{BackendRepr, TagEncoding, Variants, WrappingRange}; +use rustc_ast as ast; +use rustc_hir as hir; use rustc_hir::{Expr, ExprKind, HirId, LangItem, find_attr}; use rustc_middle::bug; use rustc_middle::ty::layout::{LayoutOf, SizeSkeleton}; @@ -8,7 +10,6 @@ use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt}; use rustc_session::{declare_lint, declare_lint_pass, impl_lint_pass}; use rustc_span::{Span, Symbol, sym}; use tracing::debug; -use {rustc_ast as ast, rustc_hir as hir}; mod improper_ctypes; // these files do the implementation for ImproperCTypesDefinitions,ImproperCTypesDeclarations pub(crate) use improper_ctypes::ImproperCTypesLint; diff --git a/compiler/rustc_lint/src/types/literal.rs b/compiler/rustc_lint/src/types/literal.rs index 71e011049e83..45d79fec75ae 100644 --- a/compiler/rustc_lint/src/types/literal.rs +++ b/compiler/rustc_lint/src/types/literal.rs @@ -2,12 +2,13 @@ use hir::{ExprKind, Node}; use rustc_abi::{Integer, Size}; use rustc_apfloat::Float; use rustc_apfloat::ieee::{DoubleS, HalfS, IeeeFloat, QuadS, Semantics, SingleS}; +use rustc_ast as ast; +use rustc_hir as hir; use rustc_hir::{HirId, attrs}; use rustc_middle::ty::Ty; use rustc_middle::ty::layout::IntegerExt; use rustc_middle::{bug, ty}; use rustc_span::{Span, Symbol}; -use {rustc_ast as ast, rustc_hir as hir}; use crate::LateContext; use crate::context::LintContext; diff --git a/compiler/rustc_metadata/src/rmeta/mod.rs b/compiler/rustc_metadata/src/rmeta/mod.rs index af6df0cd6eb6..80d7ae4e9cb3 100644 --- a/compiler/rustc_metadata/src/rmeta/mod.rs +++ b/compiler/rustc_metadata/src/rmeta/mod.rs @@ -8,8 +8,10 @@ use encoder::EncodeContext; pub use encoder::{EncodedMetadata, encode_metadata, rendered_const}; pub(crate) use parameterized::ParameterizedOverTcx; use rustc_abi::{FieldIdx, ReprOptions, VariantIdx}; +use rustc_ast as ast; use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::svh::Svh; +use rustc_hir as hir; use rustc_hir::attrs::StrippedCfgItem; use rustc_hir::def::{CtorKind, DefKind, DocLinkResMap, MacroKinds}; use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, DefIndex, DefPathHash, StableCrateId}; @@ -41,7 +43,6 @@ use rustc_span::hygiene::{ExpnIndex, MacroKind, SyntaxContextKey}; use rustc_span::{self, ExpnData, ExpnHash, ExpnId, Ident, Span, Symbol}; use rustc_target::spec::{PanicStrategy, TargetTuple}; use table::TableBuilder; -use {rustc_ast as ast, rustc_hir as hir}; use crate::creader::CrateMetadataRef; use crate::eii::EiiMapEncodedKeyValue; diff --git a/compiler/rustc_middle/src/ich/impls_syntax.rs b/compiler/rustc_middle/src/ich/impls_syntax.rs index be4e5333c64b..1063b37be87e 100644 --- a/compiler/rustc_middle/src/ich/impls_syntax.rs +++ b/compiler/rustc_middle/src/ich/impls_syntax.rs @@ -1,10 +1,11 @@ //! This module contains `HashStable` implementations for various data types //! from various crates in no particular order. +use rustc_ast as ast; use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; +use rustc_hir as hir; use rustc_span::{SourceFile, Symbol, sym}; use smallvec::SmallVec; -use {rustc_ast as ast, rustc_hir as hir}; use super::StableHashingContext; diff --git a/compiler/rustc_middle/src/queries.rs b/compiler/rustc_middle/src/queries.rs index db98d6cf5ae5..c4432715899d 100644 --- a/compiler/rustc_middle/src/queries.rs +++ b/compiler/rustc_middle/src/queries.rs @@ -69,8 +69,10 @@ use std::ffi::OsStr; use std::path::PathBuf; use std::sync::Arc; +use rustc_abi as abi; use rustc_abi::Align; use rustc_arena::TypedArena; +use rustc_ast as ast; use rustc_ast::expand::allocator::AllocatorKind; use rustc_ast::tokenstream::TokenStream; use rustc_data_structures::fx::{FxIndexMap, FxIndexSet}; @@ -79,6 +81,7 @@ use rustc_data_structures::steal::Steal; use rustc_data_structures::svh::Svh; use rustc_data_structures::unord::{UnordMap, UnordSet}; use rustc_errors::ErrorGuaranteed; +use rustc_hir as hir; use rustc_hir::attrs::{EiiDecl, EiiImpl, StrippedCfgItem}; use rustc_hir::def::{DefKind, DocLinkResMap}; use rustc_hir::def_id::{ @@ -99,7 +102,6 @@ use rustc_span::def_id::LOCAL_CRATE; use rustc_span::source_map::Spanned; use rustc_span::{DUMMY_SP, LocalExpnId, Span, Symbol}; use rustc_target::spec::PanicStrategy; -use {rustc_abi as abi, rustc_ast as ast, rustc_hir as hir}; use crate::infer::canonical::{self, Canonical}; use crate::lint::LintExpectation; diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs index 0654c48e88cf..fe8f8abf7f57 100644 --- a/compiler/rustc_middle/src/ty/layout.rs +++ b/compiler/rustc_middle/src/ty/layout.rs @@ -1,6 +1,7 @@ use std::ops::Bound; use std::{cmp, fmt}; +use rustc_abi as abi; use rustc_abi::{ AddressSpace, Align, ExternAbi, FieldIdx, FieldsShape, HasDataLayout, LayoutData, PointeeInfo, PointerKind, Primitive, ReprFlags, ReprOptions, Scalar, Size, TagEncoding, TargetDataLayout, @@ -10,6 +11,7 @@ use rustc_error_messages::DiagMessage; use rustc_errors::{ Diag, DiagArgValue, DiagCtxtHandle, Diagnostic, EmissionGuarantee, IntoDiagArg, Level, msg, }; +use rustc_hir as hir; use rustc_hir::LangItem; use rustc_hir::def_id::DefId; use rustc_macros::{HashStable, TyDecodable, TyEncodable, extension}; @@ -18,7 +20,6 @@ use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span, Symbol, sym}; use rustc_target::callconv::FnAbi; use rustc_target::spec::{HasTargetSpec, HasX86AbiOpt, Target, X86Abi}; use tracing::debug; -use {rustc_abi as abi, rustc_hir as hir}; use crate::middle::codegen_fn_attrs::CodegenFnAttrFlags; use crate::query::TyCtxtAt; diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index 9a78b3548850..274309f6c80a 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -26,6 +26,7 @@ pub use intrinsic::IntrinsicDef; use rustc_abi::{ Align, FieldIdx, Integer, IntegerType, ReprFlags, ReprOptions, ScalableElt, VariantIdx, }; +use rustc_ast as ast; use rustc_ast::AttrVec; use rustc_ast::expand::typetree::{FncTree, Kind, Type, TypeTree}; use rustc_ast::node_id::NodeMap; @@ -37,6 +38,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::steal::Steal; use rustc_data_structures::unord::{UnordMap, UnordSet}; use rustc_errors::{Diag, ErrorGuaranteed, LintBuffer}; +use rustc_hir as hir; use rustc_hir::attrs::StrippedCfgItem; use rustc_hir::def::{CtorKind, CtorOf, DefKind, DocLinkResMap, LifetimeRes, Res}; use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LocalDefId, LocalDefIdMap}; @@ -68,7 +70,6 @@ pub use rustc_type_ir::*; use rustc_type_ir::{InferCtxtLike, Interner}; use tracing::{debug, instrument, trace}; pub use vtable::*; -use {rustc_ast as ast, rustc_hir as hir}; pub use self::closure::{ BorrowKind, CAPTURE_STRUCT_LOCAL, CaptureInfo, CapturedPlace, ClosureTypeInfo, diff --git a/compiler/rustc_public/src/ty.rs b/compiler/rustc_public/src/ty.rs index 4800bf1e84e9..8205d29c4534 100644 --- a/compiler/rustc_public/src/ty.rs +++ b/compiler/rustc_public/src/ty.rs @@ -1577,7 +1577,8 @@ macro_rules! serialize_index_impl { } }; } -pub(crate) use {index_impl, serialize_index_impl}; +pub(crate) use index_impl; +pub(crate) use serialize_index_impl; index_impl!(TyConstId); index_impl!(MirConstId); diff --git a/compiler/rustc_ty_utils/src/layout.rs b/compiler/rustc_ty_utils/src/layout.rs index a095ee7cbbba..391f50edf23f 100644 --- a/compiler/rustc_ty_utils/src/layout.rs +++ b/compiler/rustc_ty_utils/src/layout.rs @@ -1,4 +1,5 @@ use hir::def_id::DefId; +use rustc_abi as abi; use rustc_abi::Integer::{I8, I32}; use rustc_abi::Primitive::{self, Float, Int, Pointer}; use rustc_abi::{ @@ -7,6 +8,7 @@ use rustc_abi::{ TagEncoding, VariantIdx, Variants, WrappingRange, }; use rustc_hashes::Hash64; +use rustc_hir as hir; use rustc_hir::find_attr; use rustc_index::{Idx as _, IndexVec}; use rustc_middle::bug; @@ -22,7 +24,6 @@ use rustc_middle::ty::{ use rustc_session::{DataTypeKind, FieldInfo, FieldKind, SizeKind, VariantInfo}; use rustc_span::{Symbol, sym}; use tracing::{debug, instrument}; -use {rustc_abi as abi, rustc_hir as hir}; use crate::errors::NonPrimitiveSimdType; diff --git a/library/alloctests/tests/slice.rs b/library/alloctests/tests/slice.rs index 1e15d54d979a..1194e48f38cf 100644 --- a/library/alloctests/tests/slice.rs +++ b/library/alloctests/tests/slice.rs @@ -909,7 +909,8 @@ fn test_split_iterators_size_hint() { // become maximally long, so the size_hint upper bounds are tight ((|_| true) as fn(&_) -> _, Bounds::Upper), ] { - use {assert_tight_size_hints as a, format_args as f}; + use assert_tight_size_hints as a; + use format_args as f; a(v.split(p), b, "split"); a(v.split_mut(p), b, "split_mut"); diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index b252aab6dbb1..c595a0ae2d48 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -7,9 +7,11 @@ use std::{fmt, iter}; use arrayvec::ArrayVec; use itertools::Either; use rustc_abi::{ExternAbi, VariantIdx}; +use rustc_ast as ast; use rustc_ast::attr::AttributeExt; use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet}; use rustc_data_structures::thin_vec::ThinVec; +use rustc_hir as hir; use rustc_hir::attrs::{AttributeKind, DeprecatedSince, Deprecation, DocAttribute}; use rustc_hir::def::{CtorKind, DefKind, Res}; use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE, LocalDefId}; @@ -28,7 +30,6 @@ use rustc_span::hygiene::MacroKind; use rustc_span::symbol::{Symbol, kw, sym}; use rustc_span::{DUMMY_SP, FileName, Ident, Loc, RemapPathScopeComponents}; use tracing::{debug, trace}; -use {rustc_ast as ast, rustc_hir as hir}; pub(crate) use self::ItemKind::*; pub(crate) use self::Type::{ diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs index b264bfb2a573..834b73997c95 100644 --- a/src/librustdoc/clean/utils.rs +++ b/src/librustdoc/clean/utils.rs @@ -3,9 +3,11 @@ use std::fmt::{self, Display, Write as _}; use std::sync::LazyLock as Lazy; use std::{ascii, mem}; +use rustc_ast as ast; use rustc_ast::join_path_idents; use rustc_ast::tokenstream::TokenTree; use rustc_data_structures::thin_vec::{ThinVec, thin_vec}; +use rustc_hir as hir; use rustc_hir::attrs::DocAttribute; use rustc_hir::def::{DefKind, Res}; use rustc_hir::def_id::{DefId, LOCAL_CRATE, LocalDefId}; @@ -15,7 +17,6 @@ use rustc_middle::mir; use rustc_middle::ty::{self, GenericArgKind, GenericArgsRef, TyCtxt, TypeVisitableExt}; use rustc_span::symbol::{Symbol, kw, sym}; use tracing::{debug, warn}; -use {rustc_ast as ast, rustc_hir as hir}; use crate::clean::auto_trait::synthesize_auto_trait_impls; use crate::clean::blanket_impl::synthesize_blanket_impls; diff --git a/src/tools/run-make-support/src/lib.rs b/src/tools/run-make-support/src/lib.rs index ba413724c2fe..a686b25c3432 100644 --- a/src/tools/run-make-support/src/lib.rs +++ b/src/tools/run-make-support/src/lib.rs @@ -34,9 +34,16 @@ pub mod rfs { } // Re-exports of third-party library crates. -pub use { - bstr, gimli, libc, object, regex, rustdoc_json_types, serde_json, similar, tempfile, wasmparser, -}; +pub use bstr; +pub use gimli; +pub use libc; +pub use object; +pub use regex; +pub use rustdoc_json_types; +pub use serde_json; +pub use similar; +pub use tempfile; +pub use wasmparser; // Helpers for building names of output artifacts that are potentially target-specific. pub use crate::artifact_names::{ diff --git a/tests/codegen-llvm/reg-struct-return.rs b/tests/codegen-llvm/reg-struct-return.rs index 6ffc4503c4f2..f45e66c96d63 100644 --- a/tests/codegen-llvm/reg-struct-return.rs +++ b/tests/codegen-llvm/reg-struct-return.rs @@ -90,10 +90,17 @@ pub struct FooFloat3 { } pub mod tests { - use { - Foo, Foo1, Foo2, Foo3, Foo4, Foo5, FooFloat1, FooFloat2, FooFloat3, FooOversize1, - FooOversize2, - }; + use Foo; + use Foo1; + use Foo2; + use Foo3; + use Foo4; + use Foo5; + use FooFloat1; + use FooFloat2; + use FooFloat3; + use FooOversize1; + use FooOversize2; // ENABLED: i64 @f1() // DISABLED: void @f1(ptr {{.*}}sret diff --git a/tests/run-make-cargo/thumb-none-qemu/example/src/main.rs b/tests/run-make-cargo/thumb-none-qemu/example/src/main.rs index 4b8162c4120a..cd30c56f0c3f 100644 --- a/tests/run-make-cargo/thumb-none-qemu/example/src/main.rs +++ b/tests/run-make-cargo/thumb-none-qemu/example/src/main.rs @@ -4,7 +4,8 @@ use core::fmt::Write; use cortex_m::asm; use cortex_m_rt::entry; -use {cortex_m_semihosting as semihosting, panic_halt as _}; +use cortex_m_semihosting as semihosting; +use panic_halt as _; #[entry] fn main() -> ! {