Reformat use
declarations.
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
This commit is contained in:
parent
118f9350c5
commit
84ac80f192
1865 changed files with 8367 additions and 9199 deletions
|
@ -4,20 +4,21 @@
|
|||
//! conflicts between multiple such attributes attached to the same
|
||||
//! item.
|
||||
|
||||
use crate::{errors, fluent_generated as fluent};
|
||||
use rustc_ast::{ast, AttrKind, AttrStyle, Attribute, LitKind};
|
||||
use rustc_ast::{MetaItemKind, MetaItemLit, NestedMetaItem};
|
||||
use std::cell::Cell;
|
||||
use std::collections::hash_map::Entry;
|
||||
|
||||
use rustc_ast::{
|
||||
ast, AttrKind, AttrStyle, Attribute, LitKind, MetaItemKind, MetaItemLit, NestedMetaItem,
|
||||
};
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_errors::{Applicability, IntoDiagArg, MultiSpan};
|
||||
use rustc_errors::{DiagCtxtHandle, StashKey};
|
||||
use rustc_errors::{Applicability, DiagCtxtHandle, IntoDiagArg, MultiSpan, StashKey};
|
||||
use rustc_feature::{AttributeDuplicates, AttributeType, BuiltinAttribute, BUILTIN_ATTRIBUTE_MAP};
|
||||
use rustc_hir::def_id::LocalModDefId;
|
||||
use rustc_hir::intravisit::{self, Visitor};
|
||||
use rustc_hir::{self as hir};
|
||||
use rustc_hir::{
|
||||
self, FnSig, ForeignItem, HirId, Item, ItemKind, TraitItem, CRATE_HIR_ID, CRATE_OWNER_ID,
|
||||
self as hir, self, FnSig, ForeignItem, HirId, Item, ItemKind, MethodKind, Safety, Target,
|
||||
TraitItem, CRATE_HIR_ID, CRATE_OWNER_ID,
|
||||
};
|
||||
use rustc_hir::{MethodKind, Safety, Target};
|
||||
use rustc_macros::LintDiagnostic;
|
||||
use rustc_middle::bug;
|
||||
use rustc_middle::hir::nested_filter;
|
||||
|
@ -37,10 +38,10 @@ use rustc_target::spec::abi::Abi;
|
|||
use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
|
||||
use rustc_trait_selection::infer::{TyCtxtInferExt, ValuePairs};
|
||||
use rustc_trait_selection::traits::ObligationCtxt;
|
||||
use std::cell::Cell;
|
||||
use std::collections::hash_map::Entry;
|
||||
use tracing::debug;
|
||||
|
||||
use crate::{errors, fluent_generated as fluent};
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(passes_diagnostic_diagnostic_on_unimplemented_only_for_traits)]
|
||||
struct DiagnosticOnUnimplementedOnlyForTraits;
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
//! errors. We still look for those primitives in the MIR const-checker to ensure nothing slips
|
||||
//! through, but errors for structured control flow in a `const` should be emitted here.
|
||||
|
||||
use rustc_attr as attr;
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def_id::{LocalDefId, LocalModDefId};
|
||||
use rustc_hir::intravisit::{self, Visitor};
|
||||
use rustc_middle::hir::nested_filter;
|
||||
|
@ -17,6 +15,7 @@ use rustc_middle::span_bug;
|
|||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_session::parse::feature_err;
|
||||
use rustc_span::{sym, Span, Symbol};
|
||||
use {rustc_attr as attr, rustc_hir as hir};
|
||||
|
||||
use crate::errors::SkippingConstChecks;
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// expectations such as `#[expect(unused)]` and `#[expect(dead_code)]` is live, and everything else
|
||||
// is dead.
|
||||
|
||||
use std::mem;
|
||||
|
||||
use hir::def_id::{LocalDefIdMap, LocalDefIdSet};
|
||||
use hir::ItemKind;
|
||||
use rustc_data_structures::unord::UnordSet;
|
||||
|
@ -21,7 +23,6 @@ use rustc_session::lint;
|
|||
use rustc_session::lint::builtin::DEAD_CODE;
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
use rustc_target::abi::FieldIdx;
|
||||
use std::mem;
|
||||
|
||||
use crate::errors::{
|
||||
ChangeFields, IgnoredDerivedImpls, MultipleDeadCodes, ParentInfo, UselessAssignment,
|
||||
|
|
|
@ -3,11 +3,9 @@
|
|||
use rustc_ast::Attribute;
|
||||
use rustc_data_structures::sync::Lrc;
|
||||
use rustc_expand::base::resolve_path;
|
||||
use rustc_middle::{
|
||||
middle::debugger_visualizer::{DebuggerVisualizerFile, DebuggerVisualizerType},
|
||||
query::{LocalCrate, Providers},
|
||||
ty::TyCtxt,
|
||||
};
|
||||
use rustc_middle::middle::debugger_visualizer::{DebuggerVisualizerFile, DebuggerVisualizerType};
|
||||
use rustc_middle::query::{LocalCrate, Providers};
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_session::Session;
|
||||
use rustc_span::sym;
|
||||
|
||||
|
|
|
@ -12,8 +12,7 @@
|
|||
use rustc_ast as ast;
|
||||
use rustc_hir::diagnostic_items::DiagnosticItems;
|
||||
use rustc_hir::OwnerId;
|
||||
use rustc_middle::query::LocalCrate;
|
||||
use rustc_middle::query::Providers;
|
||||
use rustc_middle::query::{LocalCrate, Providers};
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_span::def_id::{DefId, LOCAL_CRATE};
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
|
|
|
@ -6,8 +6,8 @@ use rustc_hir::def_id::{DefId, LocalDefId, CRATE_DEF_ID, LOCAL_CRATE};
|
|||
use rustc_hir::{ItemId, Node, CRATE_HIR_ID};
|
||||
use rustc_middle::query::Providers;
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_session::config::{sigpipe, CrateType, EntryFnType};
|
||||
use rustc_session::{config::RemapPathScopeComponents, RemapFileNameExt};
|
||||
use rustc_session::config::{sigpipe, CrateType, EntryFnType, RemapPathScopeComponents};
|
||||
use rustc_session::RemapFileNameExt;
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_span::{Span, Symbol};
|
||||
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
use std::{
|
||||
io::Error,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
use std::io::Error;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use crate::fluent_generated as fluent;
|
||||
use rustc_ast::Label;
|
||||
use rustc_errors::codes::*;
|
||||
use rustc_errors::{
|
||||
codes::*, Applicability, Diag, DiagCtxtHandle, DiagSymbolList, Diagnostic, EmissionGuarantee,
|
||||
Level, MultiSpan, SubdiagMessageOp, Subdiagnostic,
|
||||
Applicability, Diag, DiagCtxtHandle, DiagSymbolList, Diagnostic, EmissionGuarantee, Level,
|
||||
MultiSpan, SubdiagMessageOp, Subdiagnostic,
|
||||
};
|
||||
use rustc_hir::{self as hir, ExprKind, Target};
|
||||
use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
|
||||
|
@ -15,6 +13,7 @@ use rustc_middle::ty::{MainDefinition, Ty};
|
|||
use rustc_span::{Span, Symbol, DUMMY_SP};
|
||||
|
||||
use crate::check_attr::ProcMacroKind;
|
||||
use crate::fluent_generated as fluent;
|
||||
use crate::lang_items::Duplicate;
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
|
|
|
@ -2,13 +2,11 @@
|
|||
// pieces of AST and HIR. The resulting numbers are good approximations but not
|
||||
// completely accurate (some things might be counted twice, others missed).
|
||||
|
||||
use rustc_ast::visit as ast_visit;
|
||||
use rustc_ast::visit::BoundKind;
|
||||
use rustc_ast::{self as ast, AttrId, NodeId};
|
||||
use rustc_ast::{self as ast, visit as ast_visit, AttrId, NodeId};
|
||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::intravisit as hir_visit;
|
||||
use rustc_hir::HirId;
|
||||
use rustc_hir::{intravisit as hir_visit, HirId};
|
||||
use rustc_middle::hir::map::Map;
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_middle::util::common::to_readable_str;
|
||||
|
|
|
@ -7,23 +7,22 @@
|
|||
//! * Traits that represent operators; e.g., `Add`, `Sub`, `Index`.
|
||||
//! * Functions called by the compiler itself.
|
||||
|
||||
use crate::errors::{
|
||||
DuplicateLangItem, IncorrectTarget, LangItemOnIncorrectTarget, UnknownLangItem,
|
||||
};
|
||||
use crate::weak_lang_items;
|
||||
|
||||
use rustc_ast as ast;
|
||||
use rustc_ast::visit;
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_hir::def_id::{DefId, LocalDefId};
|
||||
use rustc_hir::lang_items::{extract, GenericRequirement};
|
||||
use rustc_hir::{LangItem, LanguageItems, MethodKind, Target};
|
||||
use rustc_middle::query::Providers;
|
||||
use rustc_middle::ty::{ResolverAstLowering, TyCtxt};
|
||||
use rustc_session::cstore::ExternCrate;
|
||||
use rustc_span::symbol::kw::Empty;
|
||||
use rustc_span::Span;
|
||||
|
||||
use rustc_middle::query::Providers;
|
||||
use crate::errors::{
|
||||
DuplicateLangItem, IncorrectTarget, LangItemOnIncorrectTarget, UnknownLangItem,
|
||||
};
|
||||
use crate::weak_lang_items;
|
||||
|
||||
pub(crate) enum Duplicate {
|
||||
Plain,
|
||||
|
|
|
@ -9,7 +9,8 @@ use rustc_span::symbol::sym;
|
|||
use rustc_span::Span;
|
||||
use rustc_target::abi::{HasDataLayout, TargetDataLayout};
|
||||
use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
|
||||
use rustc_trait_selection::{infer::TyCtxtInferExt, traits};
|
||||
use rustc_trait_selection::infer::TyCtxtInferExt;
|
||||
use rustc_trait_selection::traits;
|
||||
|
||||
use crate::errors::{
|
||||
LayoutAbi, LayoutAlign, LayoutHomogeneousAggregate, LayoutInvalidAttribute, LayoutOf,
|
||||
|
|
|
@ -81,10 +81,9 @@
|
|||
//! We generate various special nodes for various, well, special purposes.
|
||||
//! These are described in the `Liveness` struct.
|
||||
|
||||
use crate::errors;
|
||||
|
||||
use self::LiveNodeKind::*;
|
||||
use self::VarKind::*;
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::rc::Rc;
|
||||
|
||||
use rustc_data_structures::fx::FxIndexMap;
|
||||
use rustc_hir as hir;
|
||||
|
@ -99,11 +98,12 @@ use rustc_middle::ty::{self, RootVariableMinCaptureList, Ty, TyCtxt};
|
|||
use rustc_session::lint;
|
||||
use rustc_span::symbol::{kw, sym, Symbol};
|
||||
use rustc_span::{BytePos, Span};
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::rc::Rc;
|
||||
use tracing::{debug, instrument};
|
||||
|
||||
use self::LiveNodeKind::*;
|
||||
use self::VarKind::*;
|
||||
use crate::errors;
|
||||
|
||||
mod rwu_table;
|
||||
|
||||
rustc_index::newtype_index! {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use crate::liveness::{LiveNode, Variable};
|
||||
use std::iter;
|
||||
|
||||
use crate::liveness::{LiveNode, Variable};
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub(super) struct RWU {
|
||||
pub(super) reader: bool,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
use std::collections::BTreeMap;
|
||||
use std::fmt;
|
||||
use Context::*;
|
||||
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def_id::{LocalDefId, LocalModDefId};
|
||||
|
@ -13,6 +12,7 @@ use rustc_middle::ty::TyCtxt;
|
|||
use rustc_session::Session;
|
||||
use rustc_span::hygiene::DesugaringKind;
|
||||
use rustc_span::{BytePos, Span};
|
||||
use Context::*;
|
||||
|
||||
use crate::errors::{
|
||||
BreakInsideClosure, BreakInsideCoroutine, BreakNonLoop, ContinueLabeledBlock, OutsideLoop,
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
//! A pass that annotates every item and method with its stability level,
|
||||
//! propagating default levels lexically from parent to children ast nodes.
|
||||
|
||||
use crate::errors;
|
||||
use std::mem::replace;
|
||||
use std::num::NonZero;
|
||||
|
||||
use rustc_attr::{
|
||||
self as attr, ConstStability, DeprecatedSince, Stability, StabilityLevel, StableSince,
|
||||
Unstable, UnstableReason, VERSION_PLACEHOLDER,
|
||||
|
@ -25,10 +27,10 @@ use rustc_session::lint::builtin::{INEFFECTIVE_UNSTABLE_TRAIT_IMPL, USELESS_DEPR
|
|||
use rustc_span::symbol::{sym, Symbol};
|
||||
use rustc_span::Span;
|
||||
use rustc_target::spec::abi::Abi;
|
||||
use std::mem::replace;
|
||||
use std::num::NonZero;
|
||||
use tracing::{debug, info};
|
||||
|
||||
use crate::errors;
|
||||
|
||||
#[derive(PartialEq)]
|
||||
enum AnnotationKind {
|
||||
/// Annotation is required if not inherited from unstable parents.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue