From 3216c7656afbada6af3cbf77ef5236a7153f58e8 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Fri, 8 Feb 2019 00:56:05 +0900 Subject: [PATCH 1/3] Rename rustc_errors dependency in rust 2018 crates --- src/librustc/Cargo.toml | 2 +- src/librustc/dep_graph/graph.rs | 2 +- src/librustc/hir/lowering.rs | 2 +- src/librustc/hir/mod.rs | 2 +- src/librustc/infer/error_reporting/mod.rs | 2 +- src/librustc/infer/error_reporting/need_type_info.rs | 2 +- .../nice_region_error/named_anon_conflict.rs | 2 +- .../nice_region_error/placeholder_error.rs | 2 +- .../nice_region_error/static_impl_trait.rs | 2 +- src/librustc/infer/error_reporting/note.rs | 2 +- src/librustc/infer/mod.rs | 2 +- src/librustc/lib.rs | 2 -- src/librustc/lint/builtin.rs | 2 +- src/librustc/lint/context.rs | 2 +- src/librustc/lint/levels.rs | 2 +- src/librustc/lint/mod.rs | 2 +- src/librustc/middle/lib_features.rs | 2 +- src/librustc/middle/liveness.rs | 2 +- src/librustc/middle/resolve_lifetime.rs | 2 +- src/librustc/mir/interpret/error.rs | 2 +- src/librustc/session/config.rs | 3 +-- src/librustc/session/mod.rs | 4 ++-- src/librustc/traits/coherence.rs | 2 +- src/librustc/traits/error_reporting.rs | 2 +- src/librustc/traits/select.rs | 2 +- src/librustc/ty/context.rs | 4 ++-- src/librustc/ty/error.rs | 2 +- src/librustc/ty/query/mod.rs | 2 +- src/librustc/ty/query/on_disk_cache.rs | 2 +- src/librustc/ty/query/plumbing.rs | 8 ++++---- src/librustc_resolve/Cargo.toml | 2 +- src/librustc_resolve/build_reduced_graph.rs | 2 +- src/librustc_resolve/lib.rs | 2 -- src/librustc_resolve/macros.rs | 2 +- src/libsyntax/Cargo.toml | 2 +- src/libsyntax/attr/builtin.rs | 2 +- src/libsyntax/config.rs | 2 +- src/libsyntax/diagnostics/plugin.rs | 2 +- src/libsyntax/ext/base.rs | 2 +- src/libsyntax/ext/expand.rs | 2 +- src/libsyntax/ext/tt/macro_parser.rs | 2 +- src/libsyntax/ext/tt/macro_rules.rs | 4 ++-- src/libsyntax/feature_gate.rs | 2 +- src/libsyntax/json.rs | 8 ++++---- src/libsyntax/lib.rs | 6 +++--- src/libsyntax/parse/lexer/mod.rs | 3 +-- src/libsyntax/parse/lexer/unicode_chars.rs | 2 +- src/libsyntax/parse/mod.rs | 2 +- src/libsyntax/parse/parser.rs | 2 +- src/libsyntax/show_span.rs | 1 - src/libsyntax/source_map.rs | 2 +- src/libsyntax/test.rs | 2 +- src/libsyntax/test_snippet.rs | 4 ++-- src/libsyntax_ext/Cargo.toml | 2 +- src/libsyntax_ext/asm.rs | 2 +- src/libsyntax_ext/assert.rs | 2 +- src/libsyntax_ext/cfg.rs | 2 +- src/libsyntax_ext/deriving/custom.rs | 2 +- src/libsyntax_ext/format.rs | 4 ++-- src/libsyntax_ext/global_asm.rs | 2 +- src/libsyntax_ext/lib.rs | 2 -- src/libsyntax_ext/proc_macro_decls.rs | 1 - src/libsyntax_ext/proc_macro_impl.rs | 2 +- src/libsyntax_ext/proc_macro_server.rs | 2 +- 64 files changed, 72 insertions(+), 82 deletions(-) diff --git a/src/librustc/Cargo.toml b/src/librustc/Cargo.toml index c9a04f4c6834d..cb9eb32f8d21f 100644 --- a/src/librustc/Cargo.toml +++ b/src/librustc/Cargo.toml @@ -25,7 +25,7 @@ rustc-rayon-core = "0.1.1" rustc_apfloat = { path = "../librustc_apfloat" } rustc_target = { path = "../librustc_target" } rustc_data_structures = { path = "../librustc_data_structures" } -rustc_errors = { path = "../librustc_errors" } +errors = { path = "../librustc_errors", package = "rustc_errors" } serialize = { path = "../libserialize" } syntax = { path = "../libsyntax" } syntax_pos = { path = "../libsyntax_pos" } diff --git a/src/librustc/dep_graph/graph.rs b/src/librustc/dep_graph/graph.rs index e8c1cd36064e1..feaff39719b09 100644 --- a/src/librustc/dep_graph/graph.rs +++ b/src/librustc/dep_graph/graph.rs @@ -1,4 +1,4 @@ -use crate::errors::{Diagnostic, DiagnosticBuilder}; +use errors::{Diagnostic, DiagnosticBuilder}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::indexed_vec::{Idx, IndexVec}; diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 43c756def88be..1a825c44add1e 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -31,7 +31,7 @@ //! in the HIR, especially for multiple identifiers. use crate::dep_graph::DepGraph; -use crate::errors::Applicability; +use errors::Applicability; use crate::hir::{self, ParamName}; use crate::hir::HirVec; use crate::hir::map::{DefKey, DefPathData, Definitions}; diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index 3e7dd1432e1e3..e454a4502d484 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -10,7 +10,7 @@ pub use self::PrimTy::*; pub use self::UnOp::*; pub use self::UnsafeSource::*; -use crate::errors::FatalError; +use errors::FatalError; use crate::hir::def::Def; use crate::hir::def_id::{DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX}; use crate::util::nodemap::{NodeMap, FxHashSet}; diff --git a/src/librustc/infer/error_reporting/mod.rs b/src/librustc/infer/error_reporting/mod.rs index 1c23438a3b48a..f408cc9e3e417 100644 --- a/src/librustc/infer/error_reporting/mod.rs +++ b/src/librustc/infer/error_reporting/mod.rs @@ -50,7 +50,7 @@ use super::region_constraints::GenericKind; use super::{InferCtxt, RegionVariableOrigin, SubregionOrigin, TypeTrace, ValuePairs}; use crate::infer::{self, SuppressRegionErrors}; -use crate::errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString}; +use errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString}; use crate::hir; use crate::hir::def_id::DefId; use crate::hir::Node; diff --git a/src/librustc/infer/error_reporting/need_type_info.rs b/src/librustc/infer/error_reporting/need_type_info.rs index fac498bd6dd78..7c8146a1a5943 100644 --- a/src/librustc/infer/error_reporting/need_type_info.rs +++ b/src/librustc/infer/error_reporting/need_type_info.rs @@ -5,7 +5,7 @@ use crate::infer::type_variable::TypeVariableOrigin; use crate::ty::{self, Ty, Infer, TyVar}; use syntax::source_map::CompilerDesugaringKind; use syntax_pos::Span; -use crate::errors::DiagnosticBuilder; +use errors::DiagnosticBuilder; struct FindLocalByTypeVisitor<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> { infcx: &'a InferCtxt<'a, 'gcx, 'tcx>, diff --git a/src/librustc/infer/error_reporting/nice_region_error/named_anon_conflict.rs b/src/librustc/infer/error_reporting/nice_region_error/named_anon_conflict.rs index d66bb274b34ce..b10af400f2b6c 100644 --- a/src/librustc/infer/error_reporting/nice_region_error/named_anon_conflict.rs +++ b/src/librustc/infer/error_reporting/nice_region_error/named_anon_conflict.rs @@ -3,7 +3,7 @@ use crate::infer::error_reporting::nice_region_error::NiceRegionError; use crate::ty; use crate::util::common::ErrorReported; -use crate::errors::Applicability; +use errors::Applicability; impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx> { /// When given a `ConcreteFailure` for a function with arguments containing a named region and diff --git a/src/librustc/infer/error_reporting/nice_region_error/placeholder_error.rs b/src/librustc/infer/error_reporting/nice_region_error/placeholder_error.rs index 6893a1fb168b8..843fa8b0182e2 100644 --- a/src/librustc/infer/error_reporting/nice_region_error/placeholder_error.rs +++ b/src/librustc/infer/error_reporting/nice_region_error/placeholder_error.rs @@ -1,4 +1,4 @@ -use crate::errors::DiagnosticBuilder; +use errors::DiagnosticBuilder; use crate::hir::def_id::DefId; use crate::infer::error_reporting::nice_region_error::NiceRegionError; use crate::infer::lexical_region_resolve::RegionResolutionError; diff --git a/src/librustc/infer/error_reporting/nice_region_error/static_impl_trait.rs b/src/librustc/infer/error_reporting/nice_region_error/static_impl_trait.rs index 3f0297952278a..23acaeb31f8d4 100644 --- a/src/librustc/infer/error_reporting/nice_region_error/static_impl_trait.rs +++ b/src/librustc/infer/error_reporting/nice_region_error/static_impl_trait.rs @@ -4,7 +4,7 @@ use crate::infer::error_reporting::nice_region_error::NiceRegionError; use crate::infer::lexical_region_resolve::RegionResolutionError; use crate::ty::{BoundRegion, FreeRegion, RegionKind}; use crate::util::common::ErrorReported; -use crate::errors::Applicability; +use errors::Applicability; impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx> { /// Print the error message for lifetime errors when the return type is a static impl Trait. diff --git a/src/librustc/infer/error_reporting/note.rs b/src/librustc/infer/error_reporting/note.rs index 6c481e8c0c114..c05c6567bbefa 100644 --- a/src/librustc/infer/error_reporting/note.rs +++ b/src/librustc/infer/error_reporting/note.rs @@ -2,7 +2,7 @@ use crate::infer::{self, InferCtxt, SubregionOrigin}; use crate::middle::region; use crate::ty::{self, Region}; use crate::ty::error::TypeError; -use crate::errors::DiagnosticBuilder; +use errors::DiagnosticBuilder; impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { pub(super) fn note_region_origin(&self, diff --git a/src/librustc/infer/mod.rs b/src/librustc/infer/mod.rs index dabe1755b0bb6..706aae88d15ca 100644 --- a/src/librustc/infer/mod.rs +++ b/src/librustc/infer/mod.rs @@ -8,7 +8,7 @@ pub use self::ValuePairs::*; pub use crate::ty::IntVarValue; use arena::SyncDroplessArena; -use crate::errors::DiagnosticBuilder; +use errors::DiagnosticBuilder; use crate::hir::def_id::DefId; use crate::infer::canonical::{Canonical, CanonicalVarValues}; use crate::middle::free_region::RegionRelations; diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index be1475564778a..bfe59eda06e6f 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -153,8 +153,6 @@ mod rustc { pub use crate::lint; } -use rustc_errors as errors; - // FIXME(#27438): right now the unit tests of librustc don't refer to any actual // functions generated in librustc_data_structures (all // references are through generic functions), but statics are diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs index cb31441ca47e1..e6546617e2d98 100644 --- a/src/librustc/lint/builtin.rs +++ b/src/librustc/lint/builtin.rs @@ -4,7 +4,7 @@ //! compiler code, rather than using their own custom pass. Those //! lints are all available in `rustc_lint::builtin`. -use crate::errors::{Applicability, DiagnosticBuilder}; +use errors::{Applicability, DiagnosticBuilder}; use crate::lint::{LintPass, LateLintPass, LintArray}; use crate::session::Session; use syntax::ast; diff --git a/src/librustc/lint/context.rs b/src/librustc/lint/context.rs index 27ead805d5dbd..a2b34a705f780 100644 --- a/src/librustc/lint/context.rs +++ b/src/librustc/lint/context.rs @@ -34,7 +34,7 @@ use std::default::Default as StdDefault; use syntax::ast; use syntax::edition; use syntax_pos::{MultiSpan, Span, symbol::{LocalInternedString, Symbol}}; -use crate::errors::DiagnosticBuilder; +use errors::DiagnosticBuilder; use crate::hir; use crate::hir::def_id::LOCAL_CRATE; use crate::hir::intravisit as hir_visit; diff --git a/src/librustc/lint/levels.rs b/src/librustc/lint/levels.rs index 62bd54de7c929..5d2da64986843 100644 --- a/src/librustc/lint/levels.rs +++ b/src/librustc/lint/levels.rs @@ -1,6 +1,6 @@ use std::cmp; -use crate::errors::{Applicability, DiagnosticBuilder}; +use errors::{Applicability, DiagnosticBuilder}; use crate::hir::HirId; use crate::ich::StableHashingContext; use crate::lint::builtin; diff --git a/src/librustc/lint/mod.rs b/src/librustc/lint/mod.rs index 8952ae98e597e..7913afe1a4b12 100644 --- a/src/librustc/lint/mod.rs +++ b/src/librustc/lint/mod.rs @@ -23,7 +23,7 @@ pub use self::LintSource::*; use rustc_data_structures::sync::{self, Lrc}; -use crate::errors::{DiagnosticBuilder, DiagnosticId}; +use errors::{DiagnosticBuilder, DiagnosticId}; use crate::hir::def_id::{CrateNum, LOCAL_CRATE}; use crate::hir::intravisit; use crate::hir; diff --git a/src/librustc/middle/lib_features.rs b/src/librustc/middle/lib_features.rs index 45095d9bc986b..c56c98ac00872 100644 --- a/src/librustc/middle/lib_features.rs +++ b/src/librustc/middle/lib_features.rs @@ -10,7 +10,7 @@ use syntax::ast::{Attribute, MetaItem, MetaItemKind}; use syntax_pos::Span; use crate::hir::intravisit::{self, NestedVisitorMap, Visitor}; use rustc_data_structures::fx::{FxHashSet, FxHashMap}; -use crate::errors::DiagnosticId; +use errors::DiagnosticId; pub struct LibFeatures { // A map from feature to stabilisation version. diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs index 4eb7b918dd8be..68f62bd96c23b 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -102,7 +102,7 @@ use crate::hir::Node; use crate::ty::{self, TyCtxt}; use crate::ty::query::Providers; use crate::lint; -use crate::errors::Applicability; +use errors::Applicability; use crate::util::nodemap::{NodeMap, HirIdMap, HirIdSet}; use std::collections::{BTreeMap, VecDeque}; diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index f187928e0d900..0e56c1664adf1 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -11,7 +11,7 @@ use crate::hir::map::Map; use crate::hir::{GenericArg, GenericParam, ItemLocalId, LifetimeName, Node, ParamName}; use crate::ty::{self, DefIdTree, GenericParamDefKind, TyCtxt}; -use crate::errors::{Applicability, DiagnosticBuilder}; +use errors::{Applicability, DiagnosticBuilder}; use crate::rustc::lint; use rustc_data_structures::sync::Lrc; use crate::session::Session; diff --git a/src/librustc/mir/interpret/error.rs b/src/librustc/mir/interpret/error.rs index 870a51f95df1c..b0bee80e40b54 100644 --- a/src/librustc/mir/interpret/error.rs +++ b/src/librustc/mir/interpret/error.rs @@ -11,7 +11,7 @@ use super::{RawConst, Pointer, InboundsCheck, ScalarMaybeUndef}; use backtrace::Backtrace; use crate::ty::query::TyCtxtAt; -use crate::errors::DiagnosticBuilder; +use errors::DiagnosticBuilder; use syntax_pos::{Pos, Span}; use syntax::ast; diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index 1a92f2c0f7aa1..aa5bc6e48a8ea 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -19,7 +19,7 @@ use syntax::parse; use syntax::symbol::Symbol; use syntax::feature_gate::UnstableFeatures; -use crate::errors::{ColorConfig, FatalError, Handler}; +use errors::{ColorConfig, FatalError, Handler}; use getopts; use std::collections::{BTreeMap, BTreeSet}; @@ -2567,7 +2567,6 @@ mod dep_tracking { #[cfg(test)] mod tests { - use crate::errors; use getopts; use crate::lint; use crate::middle::cstore; diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index 9f387e1eab1ef..3df76bdfa60ca 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -21,8 +21,8 @@ use rustc_data_structures::sync::{ Ordering::SeqCst, }; -use crate::errors::{self, DiagnosticBuilder, DiagnosticId, Applicability}; -use crate::errors::emitter::{Emitter, EmitterWriter}; +use errors::{DiagnosticBuilder, DiagnosticId, Applicability}; +use errors::emitter::{Emitter, EmitterWriter}; use syntax::ast::{self, NodeId}; use syntax::edition::Edition; use syntax::feature_gate::{self, AttributeType}; diff --git a/src/librustc/traits/coherence.rs b/src/librustc/traits/coherence.rs index 4fe7a1507f737..a1ada9fe17f21 100644 --- a/src/librustc/traits/coherence.rs +++ b/src/librustc/traits/coherence.rs @@ -39,7 +39,7 @@ pub struct OverlapResult<'tcx> { pub involves_placeholder: bool, } -pub fn add_placeholder_note(err: &mut crate::errors::DiagnosticBuilder<'_>) { +pub fn add_placeholder_note(err: &mut errors::DiagnosticBuilder<'_>) { err.note(&format!( "this behavior recently changed as a result of a bug fix; \ see rust-lang/rust#56105 for details" diff --git a/src/librustc/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs index c17adaf1f9f98..600311e6c34b8 100644 --- a/src/librustc/traits/error_reporting.rs +++ b/src/librustc/traits/error_reporting.rs @@ -17,7 +17,7 @@ use super::{ Overflow, }; -use crate::errors::{Applicability, DiagnosticBuilder}; +use errors::{Applicability, DiagnosticBuilder}; use crate::hir; use crate::hir::Node; use crate::hir::def_id::DefId; diff --git a/src/librustc/traits/select.rs b/src/librustc/traits/select.rs index 1e4cd145e1760..d4b656f2322a6 100644 --- a/src/librustc/traits/select.rs +++ b/src/librustc/traits/select.rs @@ -103,7 +103,7 @@ impl IntercrateAmbiguityCause { /// See #23980 for details. pub fn add_intercrate_ambiguity_hint<'a, 'tcx>( &self, - err: &mut crate::errors::DiagnosticBuilder<'_>, + err: &mut errors::DiagnosticBuilder<'_>, ) { err.note(&self.intercrate_ambiguity_hint()); } diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index 11211c91c5479..0010eb98c6b35 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -2,7 +2,7 @@ use crate::dep_graph::DepGraph; use crate::dep_graph::{self, DepNode, DepConstructor}; -use crate::errors::DiagnosticBuilder; +use errors::DiagnosticBuilder; use crate::session::Session; use crate::session::config::{BorrowckMode, OutputFilenames}; use crate::session::config::CrateType; @@ -1819,7 +1819,7 @@ pub mod tls { use std::ptr; use syntax_pos; use crate::ty::query; - use crate::errors::{Diagnostic, TRACK_DIAGNOSTICS}; + use errors::{Diagnostic, TRACK_DIAGNOSTICS}; use rustc_data_structures::OnDrop; use rustc_data_structures::sync::{self, Lrc, Lock}; use rustc_data_structures::thin_vec::ThinVec; diff --git a/src/librustc/ty/error.rs b/src/librustc/ty/error.rs index d0c9677ea6ecb..e3e0ce147741f 100644 --- a/src/librustc/ty/error.rs +++ b/src/librustc/ty/error.rs @@ -4,7 +4,7 @@ use std::borrow::Cow; use std::fmt; use rustc_target::spec::abi; use syntax::ast; -use crate::errors::{Applicability, DiagnosticBuilder}; +use errors::{Applicability, DiagnosticBuilder}; use syntax_pos::Span; use crate::hir; diff --git a/src/librustc/ty/query/mod.rs b/src/librustc/ty/query/mod.rs index d002b99f385a3..cc43dbd779efc 100644 --- a/src/librustc/ty/query/mod.rs +++ b/src/librustc/ty/query/mod.rs @@ -1,5 +1,5 @@ use crate::dep_graph::{self, DepConstructor, DepNode}; -use crate::errors::DiagnosticBuilder; +use errors::DiagnosticBuilder; use crate::hir::def_id::{CrateNum, DefId, DefIndex}; use crate::hir::def::{Def, Export}; use crate::hir::{self, TraitCandidate, ItemLocalId, CodegenFnAttrs}; diff --git a/src/librustc/ty/query/on_disk_cache.rs b/src/librustc/ty/query/on_disk_cache.rs index 9c9bc0f6aa11c..8b6e1aae74f9a 100644 --- a/src/librustc/ty/query/on_disk_cache.rs +++ b/src/librustc/ty/query/on_disk_cache.rs @@ -1,5 +1,5 @@ use crate::dep_graph::{DepNodeIndex, SerializedDepNodeIndex}; -use crate::errors::Diagnostic; +use errors::Diagnostic; use crate::hir; use crate::hir::def_id::{CrateNum, DefIndex, DefId, LocalDefId, LOCAL_CRATE}; use crate::hir::map::definitions::DefPathHash; diff --git a/src/librustc/ty/query/plumbing.rs b/src/librustc/ty/query/plumbing.rs index f63fbd79825db..6b1fa359037fb 100644 --- a/src/librustc/ty/query/plumbing.rs +++ b/src/librustc/ty/query/plumbing.rs @@ -3,10 +3,10 @@ //! provider, manage the caches, and so forth. use crate::dep_graph::{DepNodeIndex, DepNode, DepKind, SerializedDepNodeIndex}; -use crate::errors::DiagnosticBuilder; -use crate::errors::Level; -use crate::errors::Diagnostic; -use crate::errors::FatalError; +use errors::DiagnosticBuilder; +use errors::Level; +use errors::Diagnostic; +use errors::FatalError; use crate::ty::tls; use crate::ty::{TyCtxt}; use crate::ty::query::Query; diff --git a/src/librustc_resolve/Cargo.toml b/src/librustc_resolve/Cargo.toml index 0ce82f2ce521b..836b4ad38ca88 100644 --- a/src/librustc_resolve/Cargo.toml +++ b/src/librustc_resolve/Cargo.toml @@ -16,7 +16,7 @@ log = "0.4" syntax = { path = "../libsyntax" } rustc = { path = "../librustc" } arena = { path = "../libarena" } -rustc_errors = { path = "../librustc_errors" } +errors = { path = "../librustc_errors", package = "rustc_errors" } syntax_pos = { path = "../libsyntax_pos" } rustc_data_structures = { path = "../librustc_data_structures" } rustc_metadata = { path = "../librustc_metadata" } diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index 750eb35a98854..c1942c47dbbe9 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -22,7 +22,7 @@ use std::cell::Cell; use std::ptr; use rustc_data_structures::sync::Lrc; -use crate::errors::Applicability; +use errors::Applicability; use syntax::ast::{Name, Ident}; use syntax::attr; diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index ad73b30ae3fd9..1a3eb82a48efa 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -10,8 +10,6 @@ #![deny(rust_2018_idioms)] -use rustc_errors as errors; - pub use rustc::hir::def::{Namespace, PerNS}; use GenericParameters::*; diff --git a/src/librustc_resolve/macros.rs b/src/librustc_resolve/macros.rs index c8c0847a28eac..74ee45abdb890 100644 --- a/src/librustc_resolve/macros.rs +++ b/src/librustc_resolve/macros.rs @@ -27,7 +27,7 @@ use syntax::symbol::{Symbol, keywords}; use syntax::visit::Visitor; use syntax::util::lev_distance::find_best_match_for_name; use syntax_pos::{Span, DUMMY_SP}; -use crate::errors::Applicability; +use errors::Applicability; use std::cell::Cell; use std::{mem, ptr}; diff --git a/src/libsyntax/Cargo.toml b/src/libsyntax/Cargo.toml index f1e60ba78b753..4a0bb0302ffbc 100644 --- a/src/libsyntax/Cargo.toml +++ b/src/libsyntax/Cargo.toml @@ -15,7 +15,7 @@ serialize = { path = "../libserialize" } log = "0.4" scoped-tls = "0.1" syntax_pos = { path = "../libsyntax_pos" } -rustc_errors = { path = "../librustc_errors" } +errors = { path = "../librustc_errors", package = "rustc_errors" } rustc_data_structures = { path = "../librustc_data_structures" } rustc_target = { path = "../librustc_target" } smallvec = { version = "0.6.7", features = ["union", "may_dangle"] } diff --git a/src/libsyntax/attr/builtin.rs b/src/libsyntax/attr/builtin.rs index 6f7761b54fc29..bb44706c1e378 100644 --- a/src/libsyntax/attr/builtin.rs +++ b/src/libsyntax/attr/builtin.rs @@ -1,7 +1,7 @@ //! Parsing and validation of builtin attributes use crate::ast::{self, Attribute, MetaItem, Name, NestedMetaItemKind}; -use crate::errors::{Applicability, Handler}; +use errors::{Applicability, Handler}; use crate::feature_gate::{Features, GatedCfg}; use crate::parse::ParseSess; diff --git a/src/libsyntax/config.rs b/src/libsyntax/config.rs index bfc4457f0547f..9565d02a9c2c2 100644 --- a/src/libsyntax/config.rs +++ b/src/libsyntax/config.rs @@ -9,7 +9,7 @@ use crate::feature_gate::{ use crate::attr; use crate::ast; use crate::edition::Edition; -use crate::errors::Applicability; +use errors::Applicability; use crate::mut_visit::*; use crate::parse::{token, ParseSess}; use crate::ptr::P; diff --git a/src/libsyntax/diagnostics/plugin.rs b/src/libsyntax/diagnostics/plugin.rs index e79378d93bd1d..21024eb41ef50 100644 --- a/src/libsyntax/diagnostics/plugin.rs +++ b/src/libsyntax/diagnostics/plugin.rs @@ -15,7 +15,7 @@ use syntax_pos::Span; use crate::diagnostics::metadata::output_metadata; -pub use crate::errors::*; +pub use errors::*; // Maximum width of any line in an extended error description (inclusive). const MAX_DESCRIPTION_WIDTH: usize = 80; diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index f7225810aca74..5c0f391d271b0 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -4,7 +4,7 @@ use crate::ast::{self, Attribute, Name, PatKind, MetaItem}; use crate::attr::HasAttrs; use crate::source_map::{SourceMap, Spanned, respan}; use crate::edition::Edition; -use crate::errors::{DiagnosticBuilder, DiagnosticId}; +use errors::{DiagnosticBuilder, DiagnosticId}; use crate::ext::expand::{self, AstFragment, Invocation}; use crate::ext::hygiene::{self, Mark, SyntaxContext, Transparency}; use crate::mut_visit::{self, MutVisitor}; diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 60359531b7f63..c007377add0b3 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -3,7 +3,7 @@ use crate::ast::{MacStmtStyle, StmtKind, ItemKind}; use crate::attr::{self, HasAttrs}; use crate::source_map::{ExpnInfo, MacroBang, MacroAttribute, dummy_spanned, respan}; use crate::config::StripUnconfigured; -use crate::errors::{Applicability, FatalError}; +use errors::{Applicability, FatalError}; use crate::ext::base::*; use crate::ext::derive::{add_derived_markers, collect_derives}; use crate::ext::hygiene::{self, Mark, SyntaxContext}; diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index a9000b89fb48e..b69a3b428bbe1 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -75,7 +75,7 @@ pub use ParseResult::*; use TokenTreeOrTokenTreeSlice::*; use crate::ast::Ident; -use crate::errors::FatalError; +use errors::FatalError; use crate::ext::tt::quoted::{self, TokenTree}; use crate::parse::{Directory, ParseSess}; use crate::parse::parser::{Parser, PathStyle}; diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index cc5531c401046..a3bdb3ba2286a 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -1,6 +1,6 @@ use crate::{ast, attr}; use crate::edition::Edition; -use crate::errors::FatalError; +use errors::FatalError; use crate::ext::base::{DummyResult, ExtCtxt, MacResult, SyntaxExtension}; use crate::ext::base::{NormalTT, TTMacroExpander}; use crate::ext::expand::{AstFragment, AstFragmentKind}; @@ -25,7 +25,7 @@ use std::borrow::Cow; use std::collections::hash_map::Entry; use rustc_data_structures::sync::Lrc; -use crate::errors::Applicability; +use errors::Applicability; const VALID_FRAGMENT_NAMES_MSG: &str = "valid fragment specifiers are \ `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `lifetime`, `literal`, \ diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 4d24c7bfb4038..8f1188d2aaa68 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -20,7 +20,7 @@ use crate::attr; use crate::early_buffered_lints::BufferedEarlyLintId; use crate::source_map::Spanned; use crate::edition::{ALL_EDITIONS, Edition}; -use crate::errors::{DiagnosticBuilder, Handler}; +use errors::{DiagnosticBuilder, Handler}; use crate::visit::{self, FnKind, Visitor}; use crate::parse::ParseSess; use crate::symbol::Symbol; diff --git a/src/libsyntax/json.rs b/src/libsyntax/json.rs index 2953b35298eab..94b25111d9d18 100644 --- a/src/libsyntax/json.rs +++ b/src/libsyntax/json.rs @@ -10,10 +10,10 @@ // FIXME: spec the JSON output properly. use crate::source_map::{SourceMap, FilePathMapping}; -use crate::errors::registry::Registry; -use crate::errors::{DiagnosticBuilder, SubDiagnostic, CodeSuggestion, SourceMapper}; -use crate::errors::{DiagnosticId, Applicability}; -use crate::errors::emitter::{Emitter, EmitterWriter}; +use errors::registry::Registry; +use errors::{DiagnosticBuilder, SubDiagnostic, CodeSuggestion, SourceMapper}; +use errors::{DiagnosticId, Applicability}; +use errors::emitter::{Emitter, EmitterWriter}; use syntax_pos::{self, MacroBacktrace, Span, SpanLabel, MultiSpan}; use rustc_data_structures::sync::{self, Lrc}; diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index c844f9e2a91ee..e0557147f9a01 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -25,7 +25,7 @@ #[allow(unused_extern_crates)] extern crate serialize as rustc_serialize; // used by deriving -pub use rustc_errors as errors; +pub use errors; use rustc_data_structures::sync::Lock; use rustc_data_structures::bit_set::GrowableBitSet; pub use rustc_data_structures::thin_vec::ThinVec; @@ -38,7 +38,7 @@ use ast::AttrId; macro_rules! panictry { ($e:expr) => ({ use std::result::Result::{Ok, Err}; - use crate::errors::FatalError; + use errors::FatalError; match $e { Ok(e) => e, Err(mut e) => { @@ -53,7 +53,7 @@ macro_rules! panictry { macro_rules! panictry_buffer { ($handler:expr, $e:expr) => ({ use std::result::Result::{Ok, Err}; - use crate::errors::{FatalError, DiagnosticBuilder}; + use errors::{FatalError, DiagnosticBuilder}; match $e { Ok(e) => e, Err(errs) => { diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index d3fc1c03634ea..1634cbfc15629 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -1,6 +1,6 @@ use crate::ast::{self, Ident}; use crate::source_map::{SourceMap, FilePathMapping}; -use crate::errors::{Applicability, FatalError, Diagnostic, DiagnosticBuilder}; +use errors::{Applicability, FatalError, Diagnostic, DiagnosticBuilder}; use crate::parse::{token, ParseSess}; use crate::symbol::{Symbol, keywords}; @@ -1882,7 +1882,6 @@ mod tests { use crate::ast::{Ident, CrateConfig}; use crate::symbol::Symbol; use crate::source_map::SourceMap; - use crate::errors; use crate::feature_gate::UnstableFeatures; use crate::parse::token; use crate::diagnostics::plugin::ErrorMap; diff --git a/src/libsyntax/parse/lexer/unicode_chars.rs b/src/libsyntax/parse/lexer/unicode_chars.rs index 75862178169ea..7da4284c0e4aa 100644 --- a/src/libsyntax/parse/lexer/unicode_chars.rs +++ b/src/libsyntax/parse/lexer/unicode_chars.rs @@ -2,7 +2,7 @@ // http://www.unicode.org/Public/security/10.0.0/confusables.txt use syntax_pos::{Span, NO_EXPANSION}; -use crate::errors::{Applicability, DiagnosticBuilder}; +use errors::{Applicability, DiagnosticBuilder}; use super::StringReader; const UNICODE_ARRAY: &[(char, &str, char)] = &[ diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 317d693320786..1ac3d8ec78166 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -3,7 +3,7 @@ use crate::ast::{self, CrateConfig, NodeId}; use crate::early_buffered_lints::{BufferedEarlyLint, BufferedEarlyLintId}; use crate::source_map::{SourceMap, FilePathMapping}; -use crate::errors::{FatalError, Level, Handler, ColorConfig, Diagnostic, DiagnosticBuilder}; +use errors::{FatalError, Level, Handler, ColorConfig, Diagnostic, DiagnosticBuilder}; use crate::feature_gate::UnstableFeatures; use crate::parse::parser::Parser; use crate::symbol::Symbol; diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 69d6407d506fb..8db8c253bad45 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -33,7 +33,7 @@ use crate::ast::{RangeEnd, RangeSyntax}; use crate::{ast, attr}; use crate::ext::base::DummyResult; use crate::source_map::{self, SourceMap, Spanned, respan}; -use crate::errors::{self, Applicability, DiagnosticBuilder, DiagnosticId}; +use errors::{Applicability, DiagnosticBuilder, DiagnosticId}; use crate::parse::{self, SeqSep, classify, token}; use crate::parse::lexer::{TokenAndSpan, UnmatchedBrace}; use crate::parse::lexer::comments::{doc_comment_style, strip_doc_comment_decoration}; diff --git a/src/libsyntax/show_span.rs b/src/libsyntax/show_span.rs index 2c32771266e7d..5e0cf9eea78b8 100644 --- a/src/libsyntax/show_span.rs +++ b/src/libsyntax/show_span.rs @@ -6,7 +6,6 @@ use std::str::FromStr; use crate::ast; -use crate::errors; use crate::visit; use crate::visit::Visitor; diff --git a/src/libsyntax/source_map.rs b/src/libsyntax/source_map.rs index 552a3d30261eb..d33415eb68a13 100644 --- a/src/libsyntax/source_map.rs +++ b/src/libsyntax/source_map.rs @@ -24,7 +24,7 @@ use std::fs; use std::io; use log::debug; -use crate::errors::SourceMapper; +use errors::SourceMapper; /// Return the span itself if it doesn't come from a macro expansion, /// otherwise return the call site span up to the `enclosing_sp` by diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs index f45bf034ba2f8..6506546b3b2ef 100644 --- a/src/libsyntax/test.rs +++ b/src/libsyntax/test.rs @@ -16,7 +16,7 @@ use syntax_pos::{self, DUMMY_SP, NO_EXPANSION, Span, SourceFile, BytePos}; use crate::attr::{self, HasAttrs}; use crate::source_map::{self, SourceMap, ExpnInfo, MacroAttribute, dummy_spanned, respan}; -use crate::errors; +use errors; use crate::config; use crate::entry::{self, EntryPointType}; use crate::ext::base::{ExtCtxt, Resolver}; diff --git a/src/libsyntax/test_snippet.rs b/src/libsyntax/test_snippet.rs index add4d2bead139..e9ea39b83d4cb 100644 --- a/src/libsyntax/test_snippet.rs +++ b/src/libsyntax/test_snippet.rs @@ -1,6 +1,6 @@ use crate::source_map::{SourceMap, FilePathMapping}; -use crate::errors::Handler; -use crate::errors::emitter::EmitterWriter; +use errors::Handler; +use errors::emitter::EmitterWriter; use crate::with_globals; use std::io; diff --git a/src/libsyntax_ext/Cargo.toml b/src/libsyntax_ext/Cargo.toml index c22b55b8c13a0..773f0948a8a10 100644 --- a/src/libsyntax_ext/Cargo.toml +++ b/src/libsyntax_ext/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["dylib"] [dependencies] fmt_macros = { path = "../libfmt_macros" } -rustc_errors = { path = "../librustc_errors" } +errors = { path = "../librustc_errors", package = "rustc_errors" } syntax = { path = "../libsyntax" } syntax_pos = { path = "../libsyntax_pos" } rustc_data_structures = { path = "../librustc_data_structures" } diff --git a/src/libsyntax_ext/asm.rs b/src/libsyntax_ext/asm.rs index ebcdceea7c5a9..8edd0e1ae3884 100644 --- a/src/libsyntax_ext/asm.rs +++ b/src/libsyntax_ext/asm.rs @@ -4,7 +4,7 @@ use State::*; use rustc_data_structures::thin_vec::ThinVec; -use crate::errors::DiagnosticBuilder; +use errors::DiagnosticBuilder; use syntax::ast; use syntax::ext::base::{self, *}; diff --git a/src/libsyntax_ext/assert.rs b/src/libsyntax_ext/assert.rs index 984ef26f5ab8b..d2c397e0eccb5 100644 --- a/src/libsyntax_ext/assert.rs +++ b/src/libsyntax_ext/assert.rs @@ -1,4 +1,4 @@ -use crate::errors::DiagnosticBuilder; +use errors::DiagnosticBuilder; use syntax::ast::{self, *}; use syntax::source_map::Spanned; diff --git a/src/libsyntax_ext/cfg.rs b/src/libsyntax_ext/cfg.rs index e2104550878ec..090d730289d26 100644 --- a/src/libsyntax_ext/cfg.rs +++ b/src/libsyntax_ext/cfg.rs @@ -2,7 +2,7 @@ /// a literal `true` or `false` based on whether the given cfg matches the /// current compilation environment. -use crate::errors::DiagnosticBuilder; +use errors::DiagnosticBuilder; use syntax::ast; use syntax::ext::base::{self, *}; diff --git a/src/libsyntax_ext/deriving/custom.rs b/src/libsyntax_ext/deriving/custom.rs index 7d9b8402cac3f..81fcdc4be2b3d 100644 --- a/src/libsyntax_ext/deriving/custom.rs +++ b/src/libsyntax_ext/deriving/custom.rs @@ -1,4 +1,4 @@ -use crate::errors::FatalError; +use errors::FatalError; use crate::proc_macro_impl::EXEC_STRATEGY; use crate::proc_macro_server; diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs index 1b17fc0d040a5..a27630a714c28 100644 --- a/src/libsyntax_ext/format.rs +++ b/src/libsyntax_ext/format.rs @@ -3,8 +3,8 @@ use Position::*; use fmt_macros as parse; -use crate::errors::DiagnosticBuilder; -use crate::errors::Applicability; +use errors::DiagnosticBuilder; +use errors::Applicability; use syntax::ast; use syntax::ext::base::{self, *}; diff --git a/src/libsyntax_ext/global_asm.rs b/src/libsyntax_ext/global_asm.rs index 14dbd9300232b..2baf530aedae7 100644 --- a/src/libsyntax_ext/global_asm.rs +++ b/src/libsyntax_ext/global_asm.rs @@ -8,7 +8,7 @@ /// LLVM's `module asm "some assembly here"`. All of LLVM's caveats /// therefore apply. -use crate::errors::DiagnosticBuilder; +use errors::DiagnosticBuilder; use syntax::ast; use syntax::source_map::respan; diff --git a/src/libsyntax_ext/lib.rs b/src/libsyntax_ext/lib.rs index 05c8084a51ed2..69f9e2c5eb0ec 100644 --- a/src/libsyntax_ext/lib.rs +++ b/src/libsyntax_ext/lib.rs @@ -17,8 +17,6 @@ extern crate proc_macro; -use rustc_errors as errors; - mod diagnostics; mod asm; diff --git a/src/libsyntax_ext/proc_macro_decls.rs b/src/libsyntax_ext/proc_macro_decls.rs index 5730081ce018a..d8f8decef39b1 100644 --- a/src/libsyntax_ext/proc_macro_decls.rs +++ b/src/libsyntax_ext/proc_macro_decls.rs @@ -1,7 +1,6 @@ use std::mem; use crate::deriving; -use crate::errors; use syntax::ast::{self, Ident}; use syntax::attr; diff --git a/src/libsyntax_ext/proc_macro_impl.rs b/src/libsyntax_ext/proc_macro_impl.rs index 88e20e3dc7c9e..03290df0c72ae 100644 --- a/src/libsyntax_ext/proc_macro_impl.rs +++ b/src/libsyntax_ext/proc_macro_impl.rs @@ -1,4 +1,4 @@ -use crate::errors::FatalError; +use errors::FatalError; use crate::proc_macro_server; use syntax::source_map::Span; diff --git a/src/libsyntax_ext/proc_macro_server.rs b/src/libsyntax_ext/proc_macro_server.rs index 2158cfc089bdd..fd82dac5ab6d8 100644 --- a/src/libsyntax_ext/proc_macro_server.rs +++ b/src/libsyntax_ext/proc_macro_server.rs @@ -1,4 +1,4 @@ -use crate::errors::{self, Diagnostic, DiagnosticBuilder}; +use errors::{Diagnostic, DiagnosticBuilder}; use std::panic; From c360ba285c5a74ce659811a0c72fb7bf32ec0b85 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sat, 9 Feb 2019 11:24:02 +0900 Subject: [PATCH 2/3] Cleanup imports --- src/librustc/hir/lowering.rs | 10 +++++----- src/librustc/hir/mod.rs | 2 +- src/librustc/infer/error_reporting/mod.rs | 6 +++--- src/librustc/infer/mod.rs | 19 ++++++++++--------- src/librustc/lint/builtin.rs | 2 +- src/librustc/lint/levels.rs | 6 +++--- src/librustc/lint/mod.rs | 8 ++++---- src/librustc/middle/lib_features.rs | 2 +- src/librustc/middle/liveness.rs | 2 +- src/librustc/middle/resolve_lifetime.rs | 6 +++--- src/librustc/traits/error_reporting.rs | 6 +++--- src/librustc/ty/context.rs | 2 +- src/librustc/ty/query/mod.rs | 4 ++-- src/librustc/ty/query/on_disk_cache.rs | 19 ++++++++++--------- src/librustc/ty/query/plumbing.rs | 8 ++++---- src/libsyntax/attr/builtin.rs | 2 +- src/libsyntax/config.rs | 2 +- src/libsyntax/ext/base.rs | 2 +- src/libsyntax/ext/expand.rs | 2 +- src/libsyntax/ext/tt/macro_parser.rs | 4 ++-- src/libsyntax/ext/tt/macro_rules.rs | 2 +- src/libsyntax/feature_gate.rs | 2 +- src/libsyntax/json.rs | 3 ++- src/libsyntax/parse/lexer/mod.rs | 4 ++-- src/libsyntax/parse/mod.rs | 2 +- src/libsyntax/parse/parser.rs | 4 ++-- src/libsyntax/test.rs | 3 +-- src/libsyntax/test_snippet.rs | 3 ++- src/libsyntax_ext/deriving/custom.rs | 2 +- src/libsyntax_ext/proc_macro_impl.rs | 2 +- 30 files changed, 72 insertions(+), 69 deletions(-) diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 1a825c44add1e..bdf781761cc94 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -31,7 +31,6 @@ //! in the HIR, especially for multiple identifiers. use crate::dep_graph::DepGraph; -use errors::Applicability; use crate::hir::{self, ParamName}; use crate::hir::HirVec; use crate::hir::map::{DefKey, DefPathData, Definitions}; @@ -41,14 +40,15 @@ use crate::hir::GenericArg; use crate::lint::builtin::{self, PARENTHESIZED_PARAMS_IN_TYPES_AND_MODULES, ELIDED_LIFETIMES_IN_PATHS}; use crate::middle::cstore::CrateStore; -use rustc_data_structures::fx::FxHashSet; -use rustc_data_structures::indexed_vec::IndexVec; -use rustc_data_structures::thin_vec::ThinVec; -use rustc_data_structures::sync::Lrc; use crate::session::Session; use crate::session::config::nightly_options; use crate::util::common::FN_OUTPUT_NAME; use crate::util::nodemap::{DefIdMap, NodeMap}; +use errors::Applicability; +use rustc_data_structures::fx::FxHashSet; +use rustc_data_structures::indexed_vec::IndexVec; +use rustc_data_structures::thin_vec::ThinVec; +use rustc_data_structures::sync::Lrc; use std::collections::{BTreeSet, BTreeMap}; use std::fmt::Debug; diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index e454a4502d484..7238551d22e07 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -10,12 +10,12 @@ pub use self::PrimTy::*; pub use self::UnOp::*; pub use self::UnsafeSource::*; -use errors::FatalError; use crate::hir::def::Def; use crate::hir::def_id::{DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX}; use crate::util::nodemap::{NodeMap, FxHashSet}; use crate::mir::mono::Linkage; +use errors::FatalError; use syntax_pos::{Span, DUMMY_SP, symbol::InternedString}; use syntax::source_map::Spanned; use rustc_target::spec::abi::Abi; diff --git a/src/librustc/infer/error_reporting/mod.rs b/src/librustc/infer/error_reporting/mod.rs index f408cc9e3e417..93c0246474936 100644 --- a/src/librustc/infer/error_reporting/mod.rs +++ b/src/librustc/infer/error_reporting/mod.rs @@ -50,16 +50,16 @@ use super::region_constraints::GenericKind; use super::{InferCtxt, RegionVariableOrigin, SubregionOrigin, TypeTrace, ValuePairs}; use crate::infer::{self, SuppressRegionErrors}; -use errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString}; use crate::hir; use crate::hir::def_id::DefId; use crate::hir::Node; use crate::middle::region; -use std::{cmp, fmt}; -use syntax_pos::{Pos, Span}; use crate::traits::{ObligationCause, ObligationCauseCode}; use crate::ty::error::TypeError; use crate::ty::{self, subst::Subst, Region, Ty, TyCtxt, TyKind, TypeFoldable}; +use errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString}; +use std::{cmp, fmt}; +use syntax_pos::{Pos, Span}; mod note; diff --git a/src/librustc/infer/mod.rs b/src/librustc/infer/mod.rs index 706aae88d15ca..3b822e01a4264 100644 --- a/src/librustc/infer/mod.rs +++ b/src/librustc/infer/mod.rs @@ -7,21 +7,12 @@ pub use self::SubregionOrigin::*; pub use self::ValuePairs::*; pub use crate::ty::IntVarValue; -use arena::SyncDroplessArena; -use errors::DiagnosticBuilder; use crate::hir::def_id::DefId; use crate::infer::canonical::{Canonical, CanonicalVarValues}; use crate::middle::free_region::RegionRelations; use crate::middle::lang_items; use crate::middle::region; -use rustc_data_structures::unify as ut; use crate::session::config::BorrowckMode; -use std::cell::{Cell, Ref, RefCell, RefMut}; -use std::collections::BTreeMap; -use std::fmt; -use syntax::ast; -use syntax_pos::symbol::InternedString; -use syntax_pos::{self, Span}; use crate::traits::{self, ObligationCause, PredicateObligations, TraitEngine}; use crate::ty::error::{ExpectedFound, TypeError, UnconstrainedNumeric}; use crate::ty::fold::TypeFoldable; @@ -31,6 +22,16 @@ use crate::ty::{self, GenericParamDefKind, Ty, TyCtxt, CtxtInterners}; use crate::ty::{FloatVid, IntVid, TyVid}; use crate::util::nodemap::FxHashMap; +use arena::SyncDroplessArena; +use errors::DiagnosticBuilder; +use rustc_data_structures::unify as ut; +use std::cell::{Cell, Ref, RefCell, RefMut}; +use std::collections::BTreeMap; +use std::fmt; +use syntax::ast; +use syntax_pos::symbol::InternedString; +use syntax_pos::Span; + use self::combine::CombineFields; use self::lexical_region_resolve::LexicalRegionResolutions; use self::outlives::env::OutlivesEnvironment; diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs index e6546617e2d98..6f10b0e2c0e67 100644 --- a/src/librustc/lint/builtin.rs +++ b/src/librustc/lint/builtin.rs @@ -4,9 +4,9 @@ //! compiler code, rather than using their own custom pass. Those //! lints are all available in `rustc_lint::builtin`. -use errors::{Applicability, DiagnosticBuilder}; use crate::lint::{LintPass, LateLintPass, LintArray}; use crate::session::Session; +use errors::{Applicability, DiagnosticBuilder}; use syntax::ast; use syntax::source_map::Span; diff --git a/src/librustc/lint/levels.rs b/src/librustc/lint/levels.rs index 5d2da64986843..924aa3fde0a08 100644 --- a/src/librustc/lint/levels.rs +++ b/src/librustc/lint/levels.rs @@ -1,20 +1,20 @@ use std::cmp; -use errors::{Applicability, DiagnosticBuilder}; use crate::hir::HirId; use crate::ich::StableHashingContext; use crate::lint::builtin; use crate::lint::context::CheckLintNameResult; use crate::lint::{self, Lint, LintId, Level, LintSource}; +use crate::session::Session; +use crate::util::nodemap::FxHashMap; +use errors::{Applicability, DiagnosticBuilder}; use rustc_data_structures::stable_hasher::{HashStable, ToStableHashKey, StableHasher, StableHasherResult}; -use crate::session::Session; use syntax::ast; use syntax::attr; use syntax::feature_gate; use syntax::source_map::MultiSpan; use syntax::symbol::Symbol; -use crate::util::nodemap::FxHashMap; pub struct LintLevelSets { list: Vec, diff --git a/src/librustc/lint/mod.rs b/src/librustc/lint/mod.rs index 7913afe1a4b12..479f93b19bcdb 100644 --- a/src/librustc/lint/mod.rs +++ b/src/librustc/lint/mod.rs @@ -23,13 +23,16 @@ pub use self::LintSource::*; use rustc_data_structures::sync::{self, Lrc}; -use errors::{DiagnosticBuilder, DiagnosticId}; use crate::hir::def_id::{CrateNum, LOCAL_CRATE}; use crate::hir::intravisit; use crate::hir; use crate::lint::builtin::{BuiltinLintDiagnostics, DUPLICATE_MATCHER_BINDING_NAME}; use crate::lint::builtin::parser::{QUESTION_MARK_MACRO_SEP, ILL_FORMED_ATTRIBUTE_INPUT}; use crate::session::{Session, DiagnosticMessageId}; +use crate::ty::TyCtxt; +use crate::ty::query::Providers; +use crate::util::nodemap::NodeMap; +use errors::{DiagnosticBuilder, DiagnosticId}; use std::{hash, ptr}; use syntax::ast; use syntax::source_map::{MultiSpan, ExpnFormat}; @@ -37,9 +40,6 @@ use syntax::early_buffered_lints::BufferedEarlyLintId; use syntax::edition::Edition; use syntax::symbol::Symbol; use syntax_pos::Span; -use crate::ty::TyCtxt; -use crate::ty::query::Providers; -use crate::util::nodemap::NodeMap; pub use crate::lint::context::{LateContext, EarlyContext, LintContext, LintStore, check_crate, check_ast_crate, CheckLintNameResult, diff --git a/src/librustc/middle/lib_features.rs b/src/librustc/middle/lib_features.rs index c56c98ac00872..331343e052dea 100644 --- a/src/librustc/middle/lib_features.rs +++ b/src/librustc/middle/lib_features.rs @@ -5,10 +5,10 @@ // (unlike lang features), which means we need to collect them instead. use crate::ty::TyCtxt; +use crate::hir::intravisit::{self, NestedVisitorMap, Visitor}; use syntax::symbol::Symbol; use syntax::ast::{Attribute, MetaItem, MetaItemKind}; use syntax_pos::Span; -use crate::hir::intravisit::{self, NestedVisitorMap, Visitor}; use rustc_data_structures::fx::{FxHashSet, FxHashMap}; use errors::DiagnosticId; diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs index 68f62bd96c23b..6ff364e37d57e 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -102,9 +102,9 @@ use crate::hir::Node; use crate::ty::{self, TyCtxt}; use crate::ty::query::Providers; use crate::lint; -use errors::Applicability; use crate::util::nodemap::{NodeMap, HirIdMap, HirIdSet}; +use errors::Applicability; use std::collections::{BTreeMap, VecDeque}; use std::{fmt, u32}; use std::io::prelude::*; diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index 0e56c1664adf1..1a2f72cfa0254 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -11,10 +11,11 @@ use crate::hir::map::Map; use crate::hir::{GenericArg, GenericParam, ItemLocalId, LifetimeName, Node, ParamName}; use crate::ty::{self, DefIdTree, GenericParamDefKind, TyCtxt}; -use errors::{Applicability, DiagnosticBuilder}; use crate::rustc::lint; -use rustc_data_structures::sync::Lrc; use crate::session::Session; +use crate::util::nodemap::{DefIdMap, FxHashMap, FxHashSet, NodeMap, NodeSet}; +use errors::{Applicability, DiagnosticBuilder}; +use rustc_data_structures::sync::Lrc; use std::borrow::Cow; use std::cell::Cell; use std::mem::replace; @@ -23,7 +24,6 @@ use syntax::attr; use syntax::ptr::P; use syntax::symbol::keywords; use syntax_pos::Span; -use crate::util::nodemap::{DefIdMap, FxHashMap, FxHashSet, NodeMap, NodeSet}; use crate::hir::intravisit::{self, NestedVisitorMap, Visitor}; use crate::hir::{self, GenericParamKind, LifetimeParamKind}; diff --git a/src/librustc/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs index 600311e6c34b8..55cb6e9baeccc 100644 --- a/src/librustc/traits/error_reporting.rs +++ b/src/librustc/traits/error_reporting.rs @@ -17,14 +17,11 @@ use super::{ Overflow, }; -use errors::{Applicability, DiagnosticBuilder}; use crate::hir; use crate::hir::Node; use crate::hir::def_id::DefId; use crate::infer::{self, InferCtxt}; use crate::infer::type_variable::TypeVariableOrigin; -use std::fmt; -use syntax::ast; use crate::session::DiagnosticMessageId; use crate::ty::{self, AdtKind, ToPredicate, ToPolyTraitRef, Ty, TyCtxt, TypeFoldable}; use crate::ty::GenericParamDefKind; @@ -35,6 +32,9 @@ use crate::ty::subst::Subst; use crate::ty::SubtypePredicate; use crate::util::nodemap::{FxHashMap, FxHashSet}; +use errors::{Applicability, DiagnosticBuilder}; +use std::fmt; +use syntax::ast; use syntax_pos::{DUMMY_SP, Span, ExpnInfo, ExpnFormat}; impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index 0010eb98c6b35..17b607328cc7d 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -2,7 +2,6 @@ use crate::dep_graph::DepGraph; use crate::dep_graph::{self, DepNode, DepConstructor}; -use errors::DiagnosticBuilder; use crate::session::Session; use crate::session::config::{BorrowckMode, OutputFilenames}; use crate::session::config::CrateType; @@ -43,6 +42,7 @@ use crate::ty::{BoundVar, BindingMode}; use crate::ty::CanonicalPolyFnSig; use crate::util::nodemap::{DefIdMap, DefIdSet, ItemLocalMap}; use crate::util::nodemap::{FxHashMap, FxHashSet}; +use errors::DiagnosticBuilder; use rustc_data_structures::interner::HashInterner; use smallvec::SmallVec; use rustc_data_structures::stable_hasher::{HashStable, hash_stable_hashmap, diff --git a/src/librustc/ty/query/mod.rs b/src/librustc/ty/query/mod.rs index cc43dbd779efc..6aa810dcb2f05 100644 --- a/src/librustc/ty/query/mod.rs +++ b/src/librustc/ty/query/mod.rs @@ -1,9 +1,7 @@ use crate::dep_graph::{self, DepConstructor, DepNode}; -use errors::DiagnosticBuilder; use crate::hir::def_id::{CrateNum, DefId, DefIndex}; use crate::hir::def::{Def, Export}; use crate::hir::{self, TraitCandidate, ItemLocalId, CodegenFnAttrs}; -use rustc_data_structures::svh::Svh; use crate::infer::canonical::{self, Canonical}; use crate::lint; use crate::middle::borrowck::BorrowCheckResult; @@ -44,6 +42,8 @@ use crate::util::common::{ErrorReported}; use crate::util::profiling::ProfileCategory::*; use crate::session::Session; +use errors::DiagnosticBuilder; +use rustc_data_structures::svh::Svh; use rustc_data_structures::bit_set::BitSet; use rustc_data_structures::indexed_vec::IndexVec; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; diff --git a/src/librustc/ty/query/on_disk_cache.rs b/src/librustc/ty/query/on_disk_cache.rs index 8b6e1aae74f9a..8656c21ce1064 100644 --- a/src/librustc/ty/query/on_disk_cache.rs +++ b/src/librustc/ty/query/on_disk_cache.rs @@ -1,28 +1,29 @@ use crate::dep_graph::{DepNodeIndex, SerializedDepNodeIndex}; -use errors::Diagnostic; use crate::hir; use crate::hir::def_id::{CrateNum, DefIndex, DefId, LocalDefId, LOCAL_CRATE}; use crate::hir::map::definitions::DefPathHash; use crate::ich::{CachingSourceMapView, Fingerprint}; use crate::mir::{self, interpret}; use crate::mir::interpret::{AllocDecodingSession, AllocDecodingState}; -use rustc_data_structures::fx::FxHashMap; -use rustc_data_structures::thin_vec::ThinVec; -use rustc_data_structures::sync::{Lrc, Lock, HashMapExt, Once}; -use rustc_data_structures::indexed_vec::{IndexVec, Idx}; use crate::rustc_serialize::{Decodable, Decoder, Encodable, Encoder, opaque, SpecializedDecoder, SpecializedEncoder, UseSpecializedDecodable, UseSpecializedEncodable}; use crate::session::{CrateDisambiguator, Session}; +use crate::ty; +use crate::ty::codec::{self as ty_codec, TyDecoder, TyEncoder}; +use crate::ty::context::TyCtxt; +use crate::util::common::time; + +use errors::Diagnostic; +use rustc_data_structures::fx::FxHashMap; +use rustc_data_structures::thin_vec::ThinVec; +use rustc_data_structures::sync::{Lrc, Lock, HashMapExt, Once}; +use rustc_data_structures::indexed_vec::{IndexVec, Idx}; use std::mem; use syntax::ast::NodeId; use syntax::source_map::{SourceMap, StableSourceFileId}; use syntax_pos::{BytePos, Span, DUMMY_SP, SourceFile}; use syntax_pos::hygiene::{Mark, SyntaxContext, ExpnInfo}; -use crate::ty; -use crate::ty::codec::{self as ty_codec, TyDecoder, TyEncoder}; -use crate::ty::context::TyCtxt; -use crate::util::common::time; const TAG_FILE_FOOTER: u128 = 0xC0FFEE_C0FFEE_C0FFEE_C0FFEE_C0FFEE; diff --git a/src/librustc/ty/query/plumbing.rs b/src/librustc/ty/query/plumbing.rs index 6b1fa359037fb..49c6093fb7d65 100644 --- a/src/librustc/ty/query/plumbing.rs +++ b/src/librustc/ty/query/plumbing.rs @@ -3,10 +3,6 @@ //! provider, manage the caches, and so forth. use crate::dep_graph::{DepNodeIndex, DepNode, DepKind, SerializedDepNodeIndex}; -use errors::DiagnosticBuilder; -use errors::Level; -use errors::Diagnostic; -use errors::FatalError; use crate::ty::tls; use crate::ty::{TyCtxt}; use crate::ty::query::Query; @@ -16,6 +12,10 @@ use crate::ty::item_path; use crate::util::common::{profq_msg, ProfileQueriesMsg, QueryMsg}; +use errors::DiagnosticBuilder; +use errors::Level; +use errors::Diagnostic; +use errors::FatalError; use rustc_data_structures::fx::{FxHashMap}; use rustc_data_structures::sync::{Lrc, Lock}; use rustc_data_structures::thin_vec::ThinVec; diff --git a/src/libsyntax/attr/builtin.rs b/src/libsyntax/attr/builtin.rs index bb44706c1e378..7afe84d11dcb0 100644 --- a/src/libsyntax/attr/builtin.rs +++ b/src/libsyntax/attr/builtin.rs @@ -1,10 +1,10 @@ //! Parsing and validation of builtin attributes use crate::ast::{self, Attribute, MetaItem, Name, NestedMetaItemKind}; -use errors::{Applicability, Handler}; use crate::feature_gate::{Features, GatedCfg}; use crate::parse::ParseSess; +use errors::{Applicability, Handler}; use syntax_pos::{symbol::Symbol, Span}; use super::{list_contains_name, mark_used, MetaItemKind}; diff --git a/src/libsyntax/config.rs b/src/libsyntax/config.rs index 9565d02a9c2c2..66e9fa042dfa1 100644 --- a/src/libsyntax/config.rs +++ b/src/libsyntax/config.rs @@ -9,12 +9,12 @@ use crate::feature_gate::{ use crate::attr; use crate::ast; use crate::edition::Edition; -use errors::Applicability; use crate::mut_visit::*; use crate::parse::{token, ParseSess}; use crate::ptr::P; use crate::util::map_in_place::MapInPlace; +use errors::Applicability; use smallvec::SmallVec; /// A folder that strips out items that do not belong in the current configuration. diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 5c0f391d271b0..12caf8e23de14 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -4,7 +4,6 @@ use crate::ast::{self, Attribute, Name, PatKind, MetaItem}; use crate::attr::HasAttrs; use crate::source_map::{SourceMap, Spanned, respan}; use crate::edition::Edition; -use errors::{DiagnosticBuilder, DiagnosticId}; use crate::ext::expand::{self, AstFragment, Invocation}; use crate::ext::hygiene::{self, Mark, SyntaxContext, Transparency}; use crate::mut_visit::{self, MutVisitor}; @@ -15,6 +14,7 @@ use crate::symbol::{keywords, Ident, Symbol}; use crate::ThinVec; use crate::tokenstream::{self, TokenStream}; +use errors::{DiagnosticBuilder, DiagnosticId}; use smallvec::{smallvec, SmallVec}; use syntax_pos::{Span, MultiSpan, DUMMY_SP}; diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index c007377add0b3..359db7325158b 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -3,7 +3,6 @@ use crate::ast::{MacStmtStyle, StmtKind, ItemKind}; use crate::attr::{self, HasAttrs}; use crate::source_map::{ExpnInfo, MacroBang, MacroAttribute, dummy_spanned, respan}; use crate::config::StripUnconfigured; -use errors::{Applicability, FatalError}; use crate::ext::base::*; use crate::ext::derive::{add_derived_markers, collect_derives}; use crate::ext::hygiene::{self, Mark, SyntaxContext}; @@ -20,6 +19,7 @@ use crate::tokenstream::{TokenStream, TokenTree}; use crate::visit::{self, Visitor}; use crate::util::map_in_place::MapInPlace; +use errors::{Applicability, FatalError}; use smallvec::{smallvec, SmallVec}; use syntax_pos::{Span, DUMMY_SP, FileName}; use syntax_pos::hygiene::ExpnFormat; diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index b69a3b428bbe1..fe9b5a068c45d 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -75,7 +75,6 @@ pub use ParseResult::*; use TokenTreeOrTokenTreeSlice::*; use crate::ast::Ident; -use errors::FatalError; use crate::ext::tt::quoted::{self, TokenTree}; use crate::parse::{Directory, ParseSess}; use crate::parse::parser::{Parser, PathStyle}; @@ -84,8 +83,9 @@ use crate::print::pprust; use crate::symbol::keywords; use crate::tokenstream::{DelimSpan, TokenStream}; +use errors::FatalError; use smallvec::{smallvec, SmallVec}; -use syntax_pos::{self, Span}; +use syntax_pos::Span; use rustc_data_structures::fx::FxHashMap; use std::collections::hash_map::Entry::{Occupied, Vacant}; diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index a3bdb3ba2286a..6f5a4eabb0215 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -1,6 +1,5 @@ use crate::{ast, attr}; use crate::edition::Edition; -use errors::FatalError; use crate::ext::base::{DummyResult, ExtCtxt, MacResult, SyntaxExtension}; use crate::ext::base::{NormalTT, TTMacroExpander}; use crate::ext::expand::{AstFragment, AstFragmentKind}; @@ -17,6 +16,7 @@ use crate::parse::token::Token::*; use crate::symbol::Symbol; use crate::tokenstream::{DelimSpan, TokenStream, TokenTree}; +use errors::FatalError; use syntax_pos::{Span, DUMMY_SP, symbol::Ident}; use log::debug; diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 8f1188d2aaa68..14183a496a9fa 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -20,11 +20,11 @@ use crate::attr; use crate::early_buffered_lints::BufferedEarlyLintId; use crate::source_map::Spanned; use crate::edition::{ALL_EDITIONS, Edition}; -use errors::{DiagnosticBuilder, Handler}; use crate::visit::{self, FnKind, Visitor}; use crate::parse::ParseSess; use crate::symbol::Symbol; +use errors::{DiagnosticBuilder, Handler}; use rustc_data_structures::fx::FxHashMap; use rustc_target::spec::abi::Abi; use syntax_pos::{Span, DUMMY_SP}; diff --git a/src/libsyntax/json.rs b/src/libsyntax/json.rs index 94b25111d9d18..09f77fd33dbd0 100644 --- a/src/libsyntax/json.rs +++ b/src/libsyntax/json.rs @@ -10,12 +10,13 @@ // FIXME: spec the JSON output properly. use crate::source_map::{SourceMap, FilePathMapping}; + use errors::registry::Registry; use errors::{DiagnosticBuilder, SubDiagnostic, CodeSuggestion, SourceMapper}; use errors::{DiagnosticId, Applicability}; use errors::emitter::{Emitter, EmitterWriter}; -use syntax_pos::{self, MacroBacktrace, Span, SpanLabel, MultiSpan}; +use syntax_pos::{MacroBacktrace, Span, SpanLabel, MultiSpan}; use rustc_data_structures::sync::{self, Lrc}; use std::io::{self, Write}; use std::vec; diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index 1634cbfc15629..7a16401828947 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -1,10 +1,10 @@ use crate::ast::{self, Ident}; use crate::source_map::{SourceMap, FilePathMapping}; -use errors::{Applicability, FatalError, Diagnostic, DiagnosticBuilder}; use crate::parse::{token, ParseSess}; use crate::symbol::{Symbol, keywords}; -use syntax_pos::{self, BytePos, CharPos, Pos, Span, NO_EXPANSION}; +use errors::{Applicability, FatalError, Diagnostic, DiagnosticBuilder}; +use syntax_pos::{BytePos, CharPos, Pos, Span, NO_EXPANSION}; use core::unicode::property::Pattern_White_Space; use std::borrow::Cow; diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 1ac3d8ec78166..87ca883ef7ba9 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -3,7 +3,6 @@ use crate::ast::{self, CrateConfig, NodeId}; use crate::early_buffered_lints::{BufferedEarlyLint, BufferedEarlyLintId}; use crate::source_map::{SourceMap, FilePathMapping}; -use errors::{FatalError, Level, Handler, ColorConfig, Diagnostic, DiagnosticBuilder}; use crate::feature_gate::UnstableFeatures; use crate::parse::parser::Parser; use crate::symbol::Symbol; @@ -11,6 +10,7 @@ use crate::tokenstream::{TokenStream, TokenTree}; use crate::diagnostics::plugin::ErrorMap; use crate::print::pprust::token_to_string; +use errors::{FatalError, Level, Handler, ColorConfig, Diagnostic, DiagnosticBuilder}; use rustc_data_structures::sync::{Lrc, Lock}; use syntax_pos::{Span, SourceFile, FileName, MultiSpan}; use log::debug; diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 8db8c253bad45..3eacd61c318ef 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -33,7 +33,6 @@ use crate::ast::{RangeEnd, RangeSyntax}; use crate::{ast, attr}; use crate::ext::base::DummyResult; use crate::source_map::{self, SourceMap, Spanned, respan}; -use errors::{Applicability, DiagnosticBuilder, DiagnosticId}; use crate::parse::{self, SeqSep, classify, token}; use crate::parse::lexer::{TokenAndSpan, UnmatchedBrace}; use crate::parse::lexer::comments::{doc_comment_style, strip_doc_comment_decoration}; @@ -47,8 +46,9 @@ use crate::ThinVec; use crate::tokenstream::{self, DelimSpan, TokenTree, TokenStream, TreeAndJoint}; use crate::symbol::{Symbol, keywords}; +use errors::{Applicability, DiagnosticBuilder, DiagnosticId}; use rustc_target::spec::abi::{self, Abi}; -use syntax_pos::{self, Span, MultiSpan, BytePos, FileName}; +use syntax_pos::{Span, MultiSpan, BytePos, FileName}; use log::{debug, trace}; use std::borrow::Cow; diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs index 6506546b3b2ef..56290fa771ba9 100644 --- a/src/libsyntax/test.rs +++ b/src/libsyntax/test.rs @@ -12,11 +12,10 @@ use std::vec; use log::debug; use smallvec::{smallvec, SmallVec}; -use syntax_pos::{self, DUMMY_SP, NO_EXPANSION, Span, SourceFile, BytePos}; +use syntax_pos::{DUMMY_SP, NO_EXPANSION, Span, SourceFile, BytePos}; use crate::attr::{self, HasAttrs}; use crate::source_map::{self, SourceMap, ExpnInfo, MacroAttribute, dummy_spanned, respan}; -use errors; use crate::config; use crate::entry::{self, EntryPointType}; use crate::ext::base::{ExtCtxt, Resolver}; diff --git a/src/libsyntax/test_snippet.rs b/src/libsyntax/test_snippet.rs index e9ea39b83d4cb..cf39090e1888b 100644 --- a/src/libsyntax/test_snippet.rs +++ b/src/libsyntax/test_snippet.rs @@ -1,7 +1,8 @@ use crate::source_map::{SourceMap, FilePathMapping}; +use crate::with_globals; + use errors::Handler; use errors::emitter::EmitterWriter; -use crate::with_globals; use std::io; use std::io::prelude::*; diff --git a/src/libsyntax_ext/deriving/custom.rs b/src/libsyntax_ext/deriving/custom.rs index 81fcdc4be2b3d..6aba4d83cd27c 100644 --- a/src/libsyntax_ext/deriving/custom.rs +++ b/src/libsyntax_ext/deriving/custom.rs @@ -1,7 +1,7 @@ -use errors::FatalError; use crate::proc_macro_impl::EXEC_STRATEGY; use crate::proc_macro_server; +use errors::FatalError; use syntax::ast::{self, ItemKind, Attribute, Mac}; use syntax::attr::{mark_used, mark_known}; use syntax::source_map::Span; diff --git a/src/libsyntax_ext/proc_macro_impl.rs b/src/libsyntax_ext/proc_macro_impl.rs index 03290df0c72ae..f0fc6392cd73f 100644 --- a/src/libsyntax_ext/proc_macro_impl.rs +++ b/src/libsyntax_ext/proc_macro_impl.rs @@ -1,6 +1,6 @@ -use errors::FatalError; use crate::proc_macro_server; +use errors::FatalError; use syntax::source_map::Span; use syntax::ext::base::{self, *}; use syntax::tokenstream::TokenStream; From c08b5ca4ad26250f6af17ba7e2938d9e694f2842 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sun, 10 Feb 2019 15:27:59 +0900 Subject: [PATCH 3/3] Fix rebase fail --- src/librustc_resolve/error_reporting.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_resolve/error_reporting.rs b/src/librustc_resolve/error_reporting.rs index 8300e691bbea4..0cabee71df9fb 100644 --- a/src/librustc_resolve/error_reporting.rs +++ b/src/librustc_resolve/error_reporting.rs @@ -1,5 +1,6 @@ use std::cmp::Reverse; +use errors::{Applicability, DiagnosticBuilder, DiagnosticId}; use log::debug; use rustc::hir::def::*; use rustc::hir::def::Namespace::*; @@ -9,7 +10,6 @@ use syntax::ast::{ExprKind}; use syntax::symbol::keywords; use syntax_pos::Span; -use crate::errors::{Applicability, DiagnosticBuilder, DiagnosticId}; use crate::macros::ParentScope; use crate::resolve_imports::ImportResolver; use crate::{import_candidate_to_enum_paths, is_self_type, is_self_value, path_names_to_string};