]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #68050 - Centril:canon-error, r=Mark-Simulacrum
authorYuki Okushi <huyuumi.dev@gmail.com>
Fri, 10 Jan 2020 19:50:53 +0000 (04:50 +0900)
committerGitHub <noreply@github.com>
Fri, 10 Jan 2020 19:50:53 +0000 (04:50 +0900)
Canonicalize rustc_error imports

r? @Mark-Simulacrum

138 files changed:
Cargo.lock
src/librustc/Cargo.toml
src/librustc/dep_graph/graph.rs
src/librustc/hir/check_attr.rs
src/librustc/infer/error_reporting/mod.rs
src/librustc/infer/error_reporting/need_type_info.rs
src/librustc/infer/error_reporting/nice_region_error/different_lifetimes.rs
src/librustc/infer/error_reporting/nice_region_error/mod.rs
src/librustc/infer/error_reporting/nice_region_error/named_anon_conflict.rs
src/librustc/infer/error_reporting/nice_region_error/placeholder_error.rs
src/librustc/infer/error_reporting/nice_region_error/static_impl_trait.rs
src/librustc/infer/error_reporting/note.rs
src/librustc/infer/mod.rs
src/librustc/infer/opaque_types/mod.rs
src/librustc/lint/builtin.rs
src/librustc/lint/context.rs
src/librustc/lint/internal.rs
src/librustc/lint/levels.rs
src/librustc/lint/mod.rs
src/librustc/middle/lang_items.rs
src/librustc/middle/stability.rs
src/librustc/middle/weak_lang_items.rs
src/librustc/mir/interpret/error.rs
src/librustc/traits/coherence.rs
src/librustc/traits/error_reporting.rs
src/librustc/traits/on_unimplemented.rs
src/librustc/traits/query/dropck_outlives.rs
src/librustc/traits/select.rs
src/librustc/traits/specialize/mod.rs
src/librustc/traits/util.rs
src/librustc/ty/context.rs
src/librustc/ty/error.rs
src/librustc/ty/query/on_disk_cache.rs
src/librustc/ty/query/plumbing.rs
src/librustc/util/common.rs
src/librustc_builtin_macros/Cargo.toml
src/librustc_builtin_macros/asm.rs
src/librustc_builtin_macros/assert.rs
src/librustc_builtin_macros/cfg.rs
src/librustc_builtin_macros/deriving/default.rs
src/librustc_builtin_macros/format.rs
src/librustc_builtin_macros/global_asm.rs
src/librustc_builtin_macros/proc_macro_harness.rs
src/librustc_builtin_macros/test_harness.rs
src/librustc_driver/Cargo.toml
src/librustc_driver/lib.rs
src/librustc_expand/Cargo.toml
src/librustc_expand/base.rs
src/librustc_expand/expand.rs
src/librustc_expand/lib.rs
src/librustc_expand/mbe/macro_parser.rs
src/librustc_expand/mbe/macro_rules.rs
src/librustc_expand/mbe/transcribe.rs
src/librustc_expand/parse/lexer/tests.rs
src/librustc_expand/parse/tests.rs
src/librustc_expand/proc_macro.rs
src/librustc_expand/proc_macro_server.rs
src/librustc_expand/tests.rs
src/librustc_lint/Cargo.toml
src/librustc_lint/array_into_iter.rs
src/librustc_lint/builtin.rs
src/librustc_lint/nonstandard_style.rs
src/librustc_lint/redundant_semicolon.rs
src/librustc_lint/types.rs
src/librustc_lint/unused.rs
src/librustc_metadata/Cargo.toml
src/librustc_metadata/creader.rs
src/librustc_metadata/locator.rs
src/librustc_metadata/native_libs.rs
src/librustc_mir/borrow_check/diagnostics/region_errors.rs
src/librustc_parse/lexer/unescape_error_reporting.rs
src/librustc_passes/Cargo.toml
src/librustc_passes/ast_validation.rs
src/librustc_passes/check_const.rs
src/librustc_passes/entry.rs
src/librustc_passes/intrinsicck.rs
src/librustc_passes/lib_features.rs
src/librustc_passes/liveness.rs
src/librustc_passes/loops.rs
src/librustc_passes/stability.rs
src/librustc_resolve/Cargo.toml
src/librustc_resolve/build_reduced_graph.rs
src/librustc_resolve/check_unused.rs
src/librustc_resolve/diagnostics.rs
src/librustc_resolve/imports.rs
src/librustc_resolve/late.rs
src/librustc_resolve/late/diagnostics.rs
src/librustc_resolve/lib.rs
src/librustc_resolve/lifetimes.rs
src/librustc_typeck/Cargo.toml
src/librustc_typeck/astconv.rs
src/librustc_typeck/check/autoderef.rs
src/librustc_typeck/check/callee.rs
src/librustc_typeck/check/cast.rs
src/librustc_typeck/check/coercion.rs
src/librustc_typeck/check/compare_method.rs
src/librustc_typeck/check/demand.rs
src/librustc_typeck/check/dropck.rs
src/librustc_typeck/check/expr.rs
src/librustc_typeck/check/intrinsic.rs
src/librustc_typeck/check/method/mod.rs
src/librustc_typeck/check/method/probe.rs
src/librustc_typeck/check/method/suggest.rs
src/librustc_typeck/check/mod.rs
src/librustc_typeck/check/op.rs
src/librustc_typeck/check/pat.rs
src/librustc_typeck/check/wfcheck.rs
src/librustc_typeck/check_unused.rs
src/librustc_typeck/coherence/builtin.rs
src/librustc_typeck/coherence/inherent_impls.rs
src/librustc_typeck/coherence/inherent_impls_overlap.rs
src/librustc_typeck/coherence/mod.rs
src/librustc_typeck/coherence/orphan.rs
src/librustc_typeck/coherence/unsafety.rs
src/librustc_typeck/collect.rs
src/librustc_typeck/impl_wf_check.rs
src/librustc_typeck/lib.rs
src/librustc_typeck/outlives/test.rs
src/librustc_typeck/structured_errors.rs
src/librustc_typeck/variance/test.rs
src/librustdoc/clean/types.rs
src/librustdoc/config.rs
src/librustdoc/core.rs
src/librustdoc/docfs.rs
src/librustdoc/externalfiles.rs
src/librustdoc/html/render.rs
src/librustdoc/lib.rs
src/librustdoc/markdown.rs
src/librustdoc/passes/check_code_block_syntax.rs
src/librustdoc/passes/collect_intra_doc_links.rs
src/librustdoc/test.rs
src/librustdoc/theme.rs
src/libsyntax/Cargo.toml
src/libsyntax/attr/builtin.rs
src/libsyntax/attr/mod.rs
src/libsyntax/feature_gate/check.rs
src/libsyntax/lib.rs
src/libsyntax/show_span.rs

index bbe014baa498b39019ce05d94fbcd5705df3e0f0..339389f8569e0ba4f8cdbe8b1bfea09465a21fad 100644 (file)
@@ -3654,6 +3654,7 @@ dependencies = [
  "log",
  "rustc",
  "rustc_data_structures",
+ "rustc_errors",
  "rustc_feature",
  "rustc_hir",
  "rustc_index",
index bca960202316cbe36bc77f37ff88751ad4e48940..323ce3b6cbb6dc8a82a4f90379c60f02a2c61d79 100644 (file)
@@ -26,8 +26,8 @@ rustc_hir = { path = "../librustc_hir" }
 rustc_target = { path = "../librustc_target" }
 rustc_macros = { path = "../librustc_macros" }
 rustc_data_structures = { path = "../librustc_data_structures" }
+rustc_errors = { path = "../librustc_errors" }
 rustc_index = { path = "../librustc_index" }
-errors = { path = "../librustc_errors", package = "rustc_errors" }
 rustc_serialize = { path = "../libserialize", package = "serialize" }
 syntax = { path = "../libsyntax" }
 rustc_span = { path = "../librustc_span" }
index 625aa25978e6eb265afdd588be4bb649d9363a7a..8d1efc7bc048d8510a514b7029945b4f49ec021b 100644 (file)
@@ -1,11 +1,11 @@
 use crate::ty::{self, TyCtxt};
-use errors::Diagnostic;
 use parking_lot::{Condvar, Mutex};
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
 use rustc_data_structures::profiling::QueryInvocationId;
 use rustc_data_structures::sharded::{self, Sharded};
 use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
 use rustc_data_structures::sync::{AtomicU32, AtomicU64, Lock, Lrc, Ordering};
+use rustc_errors::Diagnostic;
 use rustc_index::vec::{Idx, IndexVec};
 use smallvec::SmallVec;
 use std::collections::hash_map::Entry;
index 06b7b3194defd020fea99afe3f6041f79674dfd4..c6a996f84f46161b2d145c427cc8af5848341345 100644 (file)
@@ -9,8 +9,8 @@
 use crate::ty::query::Providers;
 use crate::ty::TyCtxt;
 
-use errors::struct_span_err;
 use rustc_error_codes::*;
+use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::def_id::DefId;
 use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
index 5e5f39e6c7a22c1512104ddb1ab2f64df5c19f45..c52d4335ea184fed6496b5e1d47dfa4be0bbb5c1 100644 (file)
     subst::{Subst, SubstsRef},
     Region, Ty, TyCtxt, TypeFoldable,
 };
+use rustc_data_structures::fx::{FxHashMap, FxHashSet};
+use rustc_error_codes::*;
+use rustc_errors::{pluralize, struct_span_err};
+use rustc_errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString};
 use rustc_hir as hir;
 use rustc_hir::def_id::DefId;
 use rustc_hir::Node;
-
-use errors::{
-    pluralize, struct_span_err, Applicability, DiagnosticBuilder, DiagnosticStyledString,
-};
-use rustc_data_structures::fx::{FxHashMap, FxHashSet};
-use rustc_error_codes::*;
 use rustc_span::{DesugaringKind, Pos, Span};
 use rustc_target::spec::abi;
 use std::{cmp, fmt};
index 16cfaec5ee91b852480cd5029fc5fd4d835ed2cb..70f7987faf4ccf83d202b3092143cdec2a1ca443 100644 (file)
@@ -3,7 +3,7 @@
 use crate::infer::InferCtxt;
 use crate::ty::print::Print;
 use crate::ty::{self, DefIdTree, Infer, Ty, TyVar};
-use errors::{struct_span_err, Applicability, DiagnosticBuilder};
+use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder};
 use rustc_hir as hir;
 use rustc_hir::def::{DefKind, Namespace};
 use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
@@ -151,12 +151,12 @@ pub enum TypeAnnotationNeeded {
     E0284,
 }
 
-impl Into<errors::DiagnosticId> for TypeAnnotationNeeded {
-    fn into(self) -> errors::DiagnosticId {
+impl Into<rustc_errors::DiagnosticId> for TypeAnnotationNeeded {
+    fn into(self) -> rustc_errors::DiagnosticId {
         match self {
-            Self::E0282 => errors::error_code!(E0282),
-            Self::E0283 => errors::error_code!(E0283),
-            Self::E0284 => errors::error_code!(E0284),
+            Self::E0282 => rustc_errors::error_code!(E0282),
+            Self::E0283 => rustc_errors::error_code!(E0283),
+            Self::E0284 => rustc_errors::error_code!(E0284),
         }
     }
 }
index b73fb40f637ed30b006697b49811b137afc4cd62..d6e50209f72ddf73471091869bd6d72ea42a31d6 100644 (file)
@@ -5,8 +5,8 @@
 use crate::infer::error_reporting::nice_region_error::NiceRegionError;
 use crate::util::common::ErrorReported;
 
-use errors::struct_span_err;
 use rustc_error_codes::*;
+use rustc_errors::struct_span_err;
 
 impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
     /// Print the error message for lifetime errors when both the concerned regions are anonymous.
index 5da65a3019395f297455536c1b14335498a9d4be..8749d6cd34bed27cff82613a032fc75c8e18b448 100644 (file)
@@ -3,7 +3,7 @@
 use crate::infer::InferCtxt;
 use crate::ty::{self, TyCtxt};
 use crate::util::common::ErrorReported;
-use errors::DiagnosticBuilder;
+use rustc_errors::DiagnosticBuilder;
 use rustc_span::source_map::Span;
 
 mod different_lifetimes;
index dacd2025da53b2957bb0789d890e9ee88a5f3a00..2344d408a43a5d39e752f4a72c09b97aeabf985c 100644 (file)
@@ -2,7 +2,7 @@
 //! where one region is named and the other is anonymous.
 use crate::infer::error_reporting::nice_region_error::NiceRegionError;
 use crate::ty;
-use errors::{struct_span_err, Applicability, DiagnosticBuilder};
+use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder};
 use rustc_hir::{FunctionRetTy, TyKind};
 
 use rustc_error_codes::*;
index f276dab5000bc20a0c6ad75d35d1f35f702b2ae4..7b31fe7cd7e4d208af4f8124867c07e4dc1feeae 100644 (file)
@@ -7,7 +7,7 @@
 use crate::ty::print::{FmtPrinter, Print, RegionHighlightMode};
 use crate::ty::subst::SubstsRef;
 use crate::ty::{self, TyCtxt};
-use errors::DiagnosticBuilder;
+use rustc_errors::DiagnosticBuilder;
 use rustc_hir::def::Namespace;
 use rustc_hir::def_id::DefId;
 
index 6c78e70a4444d785cb6da19cf65305568291f2e6..c6fc4cd3c15f7721301e49c892756df0e19f037a 100644 (file)
@@ -5,7 +5,7 @@
 use crate::infer::lexical_region_resolve::RegionResolutionError;
 use crate::ty::{BoundRegion, FreeRegion, RegionKind};
 use crate::util::common::ErrorReported;
-use errors::Applicability;
+use rustc_errors::Applicability;
 
 impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
     /// Print the error message for lifetime errors when the return type is a static impl Trait.
index a3fdcb44f996f4c3edac074cee16dd82fa038a55..6303104e39dd317e5d28aa1acf9aba320346b85d 100644 (file)
@@ -3,7 +3,7 @@
 use crate::middle::region;
 use crate::ty::error::TypeError;
 use crate::ty::{self, Region};
-use errors::{struct_span_err, DiagnosticBuilder};
+use rustc_errors::{struct_span_err, DiagnosticBuilder};
 
 use rustc_error_codes::*;
 
index 4eb8d79a067ef78ece7409f52fd35d70289330ef..f67669e367f00c9eb5f2224dff04c3968f19beb4 100644 (file)
 use crate::ty::{self, GenericParamDefKind, InferConst, Ty, TyCtxt};
 use crate::ty::{ConstVid, FloatVid, IntVid, TyVid};
 
-use errors::DiagnosticBuilder;
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
 use rustc_data_structures::sync::Lrc;
 use rustc_data_structures::unify as ut;
+use rustc_errors::DiagnosticBuilder;
 use rustc_hir as hir;
 use rustc_hir::def_id::DefId;
 use rustc_span::symbol::Symbol;
index 839e8588ff090adb0de2e356d98ef20e058bc778..a1afb1a86be44b563fe1382167d8ca1284267bf4 100644 (file)
@@ -6,10 +6,10 @@
 use crate::ty::free_region_map::FreeRegionRelations;
 use crate::ty::subst::{GenericArg, GenericArgKind, InternalSubsts, SubstsRef};
 use crate::ty::{self, GenericParamDefKind, Ty, TyCtxt};
-use errors::{struct_span_err, DiagnosticBuilder};
 use rustc::session::config::nightly_options;
 use rustc_data_structures::fx::FxHashMap;
 use rustc_data_structures::sync::Lrc;
+use rustc_errors::{struct_span_err, DiagnosticBuilder};
 use rustc_hir as hir;
 use rustc_hir::def_id::{DefId, DefIdMap};
 use rustc_hir::Node;
index 3726e6ace54b10967fb44ff80d981ca7db414cdd..f5845dcae1288415b753f5453886bc8e422ec5e6 100644 (file)
@@ -7,7 +7,7 @@
 use crate::lint::{FutureIncompatibleInfo, LateLintPass, LintArray, LintPass};
 use crate::middle::stability;
 use crate::session::Session;
-use errors::{pluralize, Applicability, DiagnosticBuilder};
+use rustc_errors::{pluralize, Applicability, DiagnosticBuilder};
 use rustc_session::declare_lint;
 use rustc_span::edition::Edition;
 use rustc_span::source_map::Span;
index ea96b15a162aaf5cd8cd018b6458a466f7c24c1e..bd561b41c57f54122fe27905b7dfcfca60553dc6 100644 (file)
 use crate::session::Session;
 use crate::ty::layout::{LayoutError, LayoutOf, TyLayout};
 use crate::ty::{self, print::Printer, subst::GenericArg, Ty, TyCtxt};
-use errors::{struct_span_err, DiagnosticBuilder};
 use rustc_data_structures::fx::FxHashMap;
 use rustc_data_structures::sync;
 use rustc_error_codes::*;
+use rustc_errors::{struct_span_err, DiagnosticBuilder};
 use rustc_hir as hir;
 use rustc_hir::def_id::{CrateNum, DefId};
 use rustc_span::{symbol::Symbol, MultiSpan, Span, DUMMY_SP};
index 69f212a9a3098ffd465d4f19cc39e3b32992274c..7b99b4af4f9ab0b10b08bd63cfe00a666b6b9657 100644 (file)
@@ -4,8 +4,8 @@
 use crate::lint::{
     EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintArray, LintContext, LintPass,
 };
-use errors::Applicability;
 use rustc_data_structures::fx::FxHashMap;
+use rustc_errors::Applicability;
 use rustc_hir::{GenericArg, HirId, MutTy, Mutability, Path, PathSegment, QPath, Ty, TyKind};
 use rustc_session::declare_tool_lint;
 use rustc_span::symbol::{sym, Symbol};
index abd52a9de50d520ab781e9b7b5ba943c0d992c3d..6ca98b44bf80cb2f477ffdc324a21f5f1c334b30 100644 (file)
@@ -5,9 +5,9 @@
 use crate::lint::context::{CheckLintNameResult, LintStore};
 use crate::lint::{self, Level, Lint, LintId, LintSource};
 use crate::session::Session;
-use errors::{struct_span_err, Applicability, DiagnosticBuilder};
 use rustc_data_structures::fx::FxHashMap;
 use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
+use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder};
 use rustc_hir::HirId;
 use rustc_span::source_map::MultiSpan;
 use rustc_span::symbol::{sym, Symbol};
index 3f43800590353dea0c72e619a27a73707c16e376..a8c1f9a664f1838c836d7dceb95dd66dd2333e47 100644 (file)
@@ -23,8 +23,8 @@
 
 use crate::lint::builtin::BuiltinLintDiagnostics;
 use crate::ty::TyCtxt;
-use errors::{DiagnosticBuilder, DiagnosticId};
 use rustc_data_structures::sync;
+use rustc_errors::{DiagnosticBuilder, DiagnosticId};
 use rustc_hir as hir;
 use rustc_session::node_id::NodeMap;
 use rustc_session::{DiagnosticMessageId, Session};
index 6f59df01a5205843ede52cc98879710a356a65d0..42fc3e030e7bb4f88cb071a633745faf1126074b 100644 (file)
@@ -14,8 +14,8 @@
 use crate::middle::weak_lang_items;
 use crate::ty::{self, TyCtxt};
 
-use errors::struct_span_err;
 use rustc_data_structures::fx::FxHashMap;
+use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::def_id::DefId;
 use rustc_hir::itemlikevisit::ItemLikeVisitor;
index f2474faa75e4402f8fe9c3245320bdf0968aaadf..93c23e40d2e2b4efd9bc120cbbb716ccee80a803 100644 (file)
@@ -7,8 +7,8 @@
 use crate::lint::{self, in_derive_expansion, Lint};
 use crate::session::{DiagnosticMessageId, Session};
 use crate::ty::{self, TyCtxt};
-use errors::DiagnosticBuilder;
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
+use rustc_errors::{Applicability, DiagnosticBuilder};
 use rustc_feature::GateIssue;
 use rustc_hir as hir;
 use rustc_hir::def::DefKind;
@@ -18,7 +18,6 @@
 use rustc_span::{MultiSpan, Span};
 use syntax::ast::CRATE_NODE_ID;
 use syntax::attr::{self, ConstStability, Deprecation, RustcDeprecation, Stability};
-use syntax::errors::Applicability;
 use syntax::feature_gate::feature_err_issue;
 
 use std::num::NonZeroU32;
index 89f385a51bc6a186339efa84650430854f57b700..fdffd1251ce8f747f73ed6bc785b187741b29964 100644 (file)
@@ -5,8 +5,8 @@
 
 use crate::hir::map::Map;
 use crate::ty::TyCtxt;
-use errors::struct_span_err;
 use rustc_data_structures::fx::FxHashSet;
+use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::def_id::DefId;
 use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
index cb11ac49cec35c5dc62e11c9549ffd779daa13fb..ed61534d5451999702c6a159a22b4a3b52074c59 100644 (file)
@@ -7,8 +7,8 @@
 use crate::ty::{self, layout, Ty};
 
 use backtrace::Backtrace;
-use errors::{struct_span_err, DiagnosticBuilder};
 use hir::GeneratorKind;
+use rustc_errors::{struct_span_err, DiagnosticBuilder};
 use rustc_hir as hir;
 use rustc_macros::HashStable;
 use rustc_span::symbol::Symbol;
index db7cda3b95bb2fb2c52b81b789be9a21131f1c32..29ea47809a077a8240a1b9113539f35a8f978881 100644 (file)
@@ -38,7 +38,7 @@ pub struct OverlapResult<'tcx> {
     pub involves_placeholder: bool,
 }
 
-pub fn add_placeholder_note(err: &mut errors::DiagnosticBuilder<'_>) {
+pub fn add_placeholder_note(err: &mut rustc_errors::DiagnosticBuilder<'_>) {
     err.note(&format!(
         "this behavior recently changed as a result of a bug fix; \
          see rust-lang/rust#56105 for details"
index b9bb68798e588fa0321eb43daeb921410bf64082..0c9a73d78a5ebe184290243e052fa6acb2f87b95 100644 (file)
@@ -21,8 +21,8 @@
 use crate::ty::TypeckTables;
 use crate::ty::{self, AdtKind, DefIdTree, ToPolyTraitRef, ToPredicate, Ty, TyCtxt, TypeFoldable};
 
-use errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder, Style};
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
+use rustc_errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder, Style};
 use rustc_hir as hir;
 use rustc_hir::def_id::{DefId, LOCAL_CRATE};
 use rustc_hir::Node;
index f1b830e43fc1d6a84c76909e663fb0d0c3d60cff..1afe153bb1361937a7f72c4be81b61df8812bee5 100644 (file)
@@ -3,8 +3,8 @@
 use crate::ty::{self, GenericParamDefKind, TyCtxt};
 use crate::util::common::ErrorReported;
 
-use errors::struct_span_err;
 use rustc_data_structures::fx::FxHashMap;
+use rustc_errors::struct_span_err;
 use rustc_hir::def_id::DefId;
 use rustc_span::symbol::{kw, sym, Symbol};
 use rustc_span::Span;
index 370acb53896d389d4338a1bd325fb3f7c57aab6d..34866b684de01a9369ed73182edf3c7093732a3f 100644 (file)
@@ -76,7 +76,7 @@ pub struct DropckOutlivesResult<'tcx> {
 impl<'tcx> DropckOutlivesResult<'tcx> {
     pub fn report_overflows(&self, tcx: TyCtxt<'tcx>, span: Span, ty: Ty<'tcx>) {
         if let Some(overflow_ty) = self.overflows.iter().next() {
-            errors::struct_span_err!(
+            rustc_errors::struct_span_err!(
                 tcx.sess,
                 span,
                 E0320,
index 1b1cb1b36e09a5fb1646ee33cf6206f65bd584f1..8b66f4926e0c88b107a45345482084b8a2d79cad 100644 (file)
@@ -102,7 +102,7 @@ pub enum IntercrateAmbiguityCause {
 impl IntercrateAmbiguityCause {
     /// Emits notes when the overlap is caused by complex intercrate ambiguities.
     /// See #23980 for details.
-    pub fn add_intercrate_ambiguity_hint(&self, err: &mut errors::DiagnosticBuilder<'_>) {
+    pub fn add_intercrate_ambiguity_hint(&self, err: &mut rustc_errors::DiagnosticBuilder<'_>) {
         err.note(&self.intercrate_ambiguity_hint());
     }
 
index d189714883845d5a2a8ad343f3f2d848f65a92eb..7b66341ef1c9642d8dc32a12b1b0663c09de175d 100644 (file)
@@ -17,8 +17,8 @@
 use crate::traits::{self, coherence, FutureCompatOverlapErrorKind, ObligationCause, TraitEngine};
 use crate::ty::subst::{InternalSubsts, Subst, SubstsRef};
 use crate::ty::{self, TyCtxt, TypeFoldable};
-use errors::struct_span_err;
 use rustc_data_structures::fx::FxHashSet;
+use rustc_errors::struct_span_err;
 use rustc_hir::def_id::DefId;
 use rustc_span::DUMMY_SP;
 
index 8355239af87a4a5d785e3a68fd11d48dfd0a7f08..65fd809657bd08fec282c73130cc6d86e9a017b0 100644 (file)
@@ -1,4 +1,4 @@
-use errors::DiagnosticBuilder;
+use rustc_errors::DiagnosticBuilder;
 use rustc_span::Span;
 use smallvec::SmallVec;
 
index 17f5b98ab208b9ebc4ac3f751a54bf07d9e636c2..1b0b5fc4d078d1d40eda532262372690d083b40c 100644 (file)
@@ -51,7 +51,6 @@
 use rustc_hir::{ItemKind, ItemLocalId, ItemLocalMap, ItemLocalSet};
 
 use arena::SyncDroplessArena;
-use errors::DiagnosticBuilder;
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
 use rustc_data_structures::profiling::SelfProfilerRef;
 use rustc_data_structures::sharded::ShardedHashMap;
@@ -59,6 +58,7 @@
     hash_stable_hashmap, HashStable, StableHasher, StableVec,
 };
 use rustc_data_structures::sync::{Lock, Lrc, WorkerLocal};
+use rustc_errors::DiagnosticBuilder;
 use rustc_index::vec::{Idx, IndexVec};
 use rustc_macros::HashStable;
 use rustc_session::node_id::NodeMap;
@@ -1613,10 +1613,10 @@ pub mod tls {
 
     use crate::dep_graph::TaskDeps;
     use crate::ty::query;
-    use errors::Diagnostic;
     use rustc_data_structures::sync::{self, Lock, Lrc};
     use rustc_data_structures::thin_vec::ThinVec;
     use rustc_data_structures::OnDrop;
+    use rustc_errors::Diagnostic;
     use std::mem;
 
     #[cfg(not(parallel_compiler))]
index 25fc484cd530150b9b94ef1139a3680affdc6275..f7612874e05b6b9b9ee5a455707eb27447cbf155 100644 (file)
@@ -1,12 +1,10 @@
 use crate::ty::{self, BoundRegion, Region, Ty, TyCtxt};
+use rustc_errors::{pluralize, Applicability, DiagnosticBuilder};
 use rustc_hir as hir;
 use rustc_hir::def_id::DefId;
-
-use errors::{Applicability, DiagnosticBuilder};
 use rustc_span::Span;
 use rustc_target::spec::abi;
 use syntax::ast;
-use syntax::errors::pluralize;
 
 use std::borrow::Cow;
 use std::fmt;
index 5d968811addd88d58fd8f8d1642ca09b8ce392ec..a81fe33831c96bc6d012c1a3a1105f145cb34f04 100644 (file)
@@ -7,10 +7,10 @@
 use crate::ty::codec::{self as ty_codec, TyDecoder, TyEncoder};
 use crate::ty::context::TyCtxt;
 use crate::ty::{self, Ty};
-use errors::Diagnostic;
 use rustc_data_structures::fx::FxHashMap;
 use rustc_data_structures::sync::{HashMapExt, Lock, Lrc, Once};
 use rustc_data_structures::thin_vec::ThinVec;
+use rustc_errors::Diagnostic;
 use rustc_hir as hir;
 use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LocalDefId, LOCAL_CRATE};
 use rustc_index::vec::{Idx, IndexVec};
index 33f2a5e3ffa75364151787c4ca507684553b81a1..84efbe21f10aa25bce31a01e0599f574e9e4e92f 100644 (file)
@@ -9,7 +9,6 @@
 use crate::ty::tls;
 use crate::ty::{self, TyCtxt};
 
-use errors::{struct_span_err, Diagnostic, DiagnosticBuilder, FatalError, Handler, Level};
 #[cfg(not(parallel_compiler))]
 use rustc_data_structures::cold_path;
 use rustc_data_structures::fx::{FxHashMap, FxHasher};
@@ -18,6 +17,7 @@
 use rustc_data_structures::sharded::Sharded;
 use rustc_data_structures::sync::{Lock, Lrc};
 use rustc_data_structures::thin_vec::ThinVec;
+use rustc_errors::{struct_span_err, Diagnostic, DiagnosticBuilder, FatalError, Handler, Level};
 use rustc_span::source_map::DUMMY_SP;
 use rustc_span::Span;
 use std::collections::hash_map::Entry;
index 9324b26a09b6f35071b1ee582d0714933457986a..19b43bfd162415089209b4c3a37f5742d021504c 100644 (file)
@@ -8,7 +8,7 @@
 #[cfg(test)]
 mod tests;
 
-pub use errors::ErrorReported;
+pub use rustc_errors::ErrorReported;
 
 pub fn to_readable_str(mut val: usize) -> String {
     let mut groups = vec![];
index f56cc938f4a2f7b720ed83f28190b5a277ab0dff..ca57068fb9a335bfe6bacea9447a04cb5625e41c 100644 (file)
@@ -10,10 +10,10 @@ path = "lib.rs"
 doctest = false
 
 [dependencies]
-errors = { path = "../librustc_errors", package = "rustc_errors" }
 fmt_macros = { path = "../libfmt_macros" }
 log = "0.4"
 rustc_data_structures = { path = "../librustc_data_structures" }
+rustc_errors = { path = "../librustc_errors" }
 rustc_feature = { path = "../librustc_feature" }
 rustc_parse = { path = "../librustc_parse" }
 rustc_target = { path = "../librustc_target" }
index 78d2d37ef56d3ee177eacc6ebe11b724648d1391..a6b45e0567c72c23516dd6f0f387318a36b909eb 100644 (file)
@@ -2,7 +2,7 @@
 //
 use State::*;
 
-use errors::{struct_span_err, DiagnosticBuilder, PResult};
+use rustc_errors::{struct_span_err, DiagnosticBuilder, PResult};
 use rustc_expand::base::*;
 use rustc_parse::parser::Parser;
 use rustc_span::symbol::{kw, sym, Symbol};
index 9043db4742bf7c842954275bf46d3753f8e7813f..c96ba516f0ced83a17ad5f7cf5b8aa3f5453bf2c 100644 (file)
@@ -1,4 +1,4 @@
-use errors::{Applicability, DiagnosticBuilder};
+use rustc_errors::{Applicability, DiagnosticBuilder};
 
 use rustc_expand::base::*;
 use rustc_parse::parser::Parser;
index 62a4dc06b1fe2b241eae6cfc4380ca51a359405f..cee62a54f0088202704eb9c3ae9b1fbbf55b94e1 100644 (file)
@@ -1,8 +1,8 @@
-/// The compiler code necessary to support the cfg! extension, which expands to
-/// a literal `true` or `false` based on whether the given cfg matches the
-/// current compilation environment.
-use errors::DiagnosticBuilder;
+//! The compiler code necessary to support the cfg! extension, which expands to
+//! a literal `true` or `false` based on whether the given cfg matches the
+//! current compilation environment.
 
+use rustc_errors::DiagnosticBuilder;
 use rustc_expand::base::{self, *};
 use rustc_span::Span;
 use syntax::ast;
index 8d3f1951373752f6de22fe047f27b81fc9670044..72c41ad9745c1ae505cd78f5cea9155b36135c9f 100644 (file)
@@ -2,7 +2,7 @@
 use crate::deriving::generic::*;
 use crate::deriving::path_std;
 
-use errors::struct_span_err;
+use rustc_errors::struct_span_err;
 use rustc_expand::base::{Annotatable, DummyResult, ExtCtxt};
 use rustc_span::symbol::{kw, sym};
 use rustc_span::Span;
index e2662faab6cb5a31dac8468b6ca990f3bad863f7..6fca74e22394465646dd5fda813fd02dbdf633e7 100644 (file)
@@ -3,10 +3,8 @@
 
 use fmt_macros as parse;
 
-use errors::pluralize;
-use errors::Applicability;
-use errors::DiagnosticBuilder;
-
+use rustc_data_structures::fx::{FxHashMap, FxHashSet};
+use rustc_errors::{pluralize, Applicability, DiagnosticBuilder};
 use rustc_expand::base::{self, *};
 use rustc_span::symbol::{sym, Symbol};
 use rustc_span::{MultiSpan, Span};
@@ -15,7 +13,6 @@
 use syntax::token;
 use syntax::tokenstream::TokenStream;
 
-use rustc_data_structures::fx::{FxHashMap, FxHashSet};
 use std::borrow::Cow;
 use std::collections::hash_map::Entry;
 
index 2bcd76e669971f5b4369759b4de1f6ecb3cc0968..052e62ee9ffd3da3008a7edb451fcbfd9b056b43 100644 (file)
@@ -1,14 +1,14 @@
-/// Module-level assembly support.
-///
-/// The macro defined here allows you to specify "top-level",
-/// "file-scoped", or "module-level" assembly. These synonyms
-/// all correspond to LLVM's module-level inline assembly instruction.
-///
-/// For example, `global_asm!("some assembly here")` codegens to
-/// LLVM's `module asm "some assembly here"`. All of LLVM's caveats
-/// therefore apply.
-use errors::DiagnosticBuilder;
+//! Module-level assembly support.
+//!
+//! The macro defined here allows you to specify "top-level",
+//! "file-scoped", or "module-level" assembly. These synonyms
+//! all correspond to LLVM's module-level inline assembly instruction.
+//!
+//! For example, `global_asm!("some assembly here")` codegens to
+//! LLVM's `module asm "some assembly here"`. All of LLVM's caveats
+//! therefore apply.
 
+use rustc_errors::DiagnosticBuilder;
 use rustc_expand::base::{self, *};
 use rustc_span::source_map::respan;
 use rustc_span::Span;
index 44968d6df96934654513d20f3d6b48f52781fe94..ae70608505130ad2420c5ad37c16e03e7ee184ee 100644 (file)
@@ -40,7 +40,7 @@ enum ProcMacro {
 struct CollectProcMacros<'a> {
     macros: Vec<ProcMacro>,
     in_root: bool,
-    handler: &'a errors::Handler,
+    handler: &'a rustc_errors::Handler,
     is_proc_macro_crate: bool,
     is_test_crate: bool,
 }
@@ -53,7 +53,7 @@ pub fn inject(
     has_proc_macro_decls: bool,
     is_test_crate: bool,
     num_crate_types: usize,
-    handler: &errors::Handler,
+    handler: &rustc_errors::Handler,
 ) -> ast::Crate {
     let ecfg = ExpansionConfig::default("proc_macro".to_string());
     let mut cx = ExtCtxt::new(sess, ecfg, resolver);
index eddf492720336db2eee9662833a34512a4fb73aa..17d180da6bfda7c1b6587902463412a1326f8b98 100644 (file)
@@ -40,7 +40,7 @@ pub fn inject(
     resolver: &mut dyn Resolver,
     should_test: bool,
     krate: &mut ast::Crate,
-    span_diagnostic: &errors::Handler,
+    span_diagnostic: &rustc_errors::Handler,
     features: &Features,
     panic_strategy: PanicStrategy,
     platform_panic_strategy: PanicStrategy,
@@ -351,7 +351,7 @@ fn is_test_case(i: &ast::Item) -> bool {
     attr::contains_name(&i.attrs, sym::rustc_test_marker)
 }
 
-fn get_test_runner(sd: &errors::Handler, krate: &ast::Crate) -> Option<ast::Path> {
+fn get_test_runner(sd: &rustc_errors::Handler, krate: &ast::Crate) -> Option<ast::Path> {
     let test_attr = attr::find_by_name(&krate.attrs, sym::test_runner)?;
     test_attr.meta_item_list().map(|meta_list| {
         if meta_list.len() != 1 {
index 5e0c853ed24738fd42621513e1d8b90f80459c69..37449f9402eff6b2d8955f5afa16567248bdef10 100644 (file)
@@ -17,7 +17,7 @@ rustc = { path = "../librustc" }
 rustc_target = { path = "../librustc_target" }
 rustc_lint = { path = "../librustc_lint" }
 rustc_data_structures = { path = "../librustc_data_structures" }
-errors = { path = "../librustc_errors", package = "rustc_errors" }
+rustc_errors = { path = "../librustc_errors" }
 rustc_feature = { path = "../librustc_feature" }
 rustc_hir = { path = "../librustc_hir" }
 rustc_metadata = { path = "../librustc_metadata" }
index a5277bcd120ed19672a579ed4eb9dd4786615abe..a1318d3506711a1644c18a5fd569be56146f10cb 100644 (file)
@@ -24,7 +24,6 @@
 pub extern crate rustc_plugin_impl as plugin;
 
 //use rustc_resolve as resolve;
-use errors::{registry::Registry, PResult};
 use rustc::lint;
 use rustc::lint::Lint;
 use rustc::middle::cstore::MetadataLoader;
@@ -37,6 +36,7 @@
 use rustc_codegen_utils::codegen_backend::CodegenBackend;
 use rustc_data_structures::profiling::print_time_passes_entry;
 use rustc_data_structures::sync::SeqCst;
+use rustc_errors::{registry::Registry, PResult};
 use rustc_feature::{find_gated_cfg, UnstableFeatures};
 use rustc_hir::def_id::LOCAL_CRATE;
 use rustc_interface::util::get_builtin_codegen_backend;
@@ -1134,7 +1134,7 @@ fn extra_compiler_flags() -> Option<(Vec<String>, bool)> {
 /// the panic into a `Result` instead.
 pub fn catch_fatal_errors<F: FnOnce() -> R, R>(f: F) -> Result<R, ErrorReported> {
     catch_unwind(panic::AssertUnwindSafe(f)).map_err(|value| {
-        if value.is::<errors::FatalErrorMarker>() {
+        if value.is::<rustc_errors::FatalErrorMarker>() {
             ErrorReported
         } else {
             panic::resume_unwind(value);
@@ -1163,20 +1163,20 @@ pub fn report_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
     // Separate the output with an empty line
     eprintln!();
 
-    let emitter = Box::new(errors::emitter::EmitterWriter::stderr(
-        errors::ColorConfig::Auto,
+    let emitter = Box::new(rustc_errors::emitter::EmitterWriter::stderr(
+        rustc_errors::ColorConfig::Auto,
         None,
         false,
         false,
         None,
         false,
     ));
-    let handler = errors::Handler::with_emitter(true, None, emitter);
+    let handler = rustc_errors::Handler::with_emitter(true, None, emitter);
 
     // a .span_bug or .bug call has already printed what
     // it wants to print.
-    if !info.payload().is::<errors::ExplicitBug>() {
-        let d = errors::Diagnostic::new(errors::Level::Bug, "unexpected panic");
+    if !info.payload().is::<rustc_errors::ExplicitBug>() {
+        let d = rustc_errors::Diagnostic::new(rustc_errors::Level::Bug, "unexpected panic");
         handler.emit_diagnostic(&d);
     }
 
index f9c15fbed362f5edc223aefee5cd3c1491eb1baa..c23846063c1dc0620c226bd68b4fbfd8618e31a6 100644 (file)
@@ -14,8 +14,8 @@ doctest = false
 rustc_serialize = { path = "../libserialize", package = "serialize" }
 log = "0.4"
 rustc_span = { path = "../librustc_span" }
-errors = { path = "../librustc_errors", package = "rustc_errors" }
 rustc_data_structures = { path = "../librustc_data_structures" }
+rustc_errors = { path = "../librustc_errors" }
 rustc_feature = { path = "../librustc_feature" }
 rustc_lexer = { path = "../librustc_lexer" }
 rustc_parse = { path = "../librustc_parse" }
index fe08c85249a2ed0cea8fd3d0651e3ed9bc312199..52ba14dbc3df06a7294da48e9252bea4b6223b20 100644 (file)
@@ -1,9 +1,15 @@
 use crate::expand::{self, AstFragment, Invocation};
 
+use rustc_data_structures::fx::FxHashMap;
+use rustc_data_structures::sync::{self, Lrc};
+use rustc_errors::{DiagnosticBuilder, DiagnosticId};
 use rustc_parse::{self, parser, DirectoryOwnership, MACRO_ARGUMENTS};
 use rustc_span::edition::Edition;
+use rustc_span::hygiene::{AstPass, ExpnData, ExpnId, ExpnKind};
 use rustc_span::source_map::SourceMap;
 use rustc_span::symbol::{kw, sym, Ident, Symbol};
+use rustc_span::{FileName, MultiSpan, Span, DUMMY_SP};
+use smallvec::{smallvec, SmallVec};
 use syntax::ast::{self, Attribute, Name, NodeId, PatKind};
 use syntax::attr::{self, Deprecation, HasAttrs, Stability};
 use syntax::mut_visit::{self, MutVisitor};
 use syntax::tokenstream::{self, TokenStream};
 use syntax::visit::Visitor;
 
-use errors::{DiagnosticBuilder, DiagnosticId};
-use rustc_data_structures::fx::FxHashMap;
-use rustc_data_structures::sync::{self, Lrc};
-use rustc_span::hygiene::{AstPass, ExpnData, ExpnId, ExpnKind};
-use rustc_span::{FileName, MultiSpan, Span, DUMMY_SP};
-use smallvec::{smallvec, SmallVec};
-
 use std::default::Default;
 use std::iter;
 use std::path::PathBuf;
index 6eead11ccb7bad63bf698d7b844aab107e73f3ff..8426391a2f389e8d73674762fccad7ee3b3d7b46 100644 (file)
@@ -5,6 +5,8 @@
 use crate::placeholders::{placeholder, PlaceholderExpander};
 use crate::proc_macro::collect_derives;
 
+use rustc_data_structures::sync::Lrc;
+use rustc_errors::{Applicability, FatalError, PResult};
 use rustc_feature::Features;
 use rustc_parse::configure;
 use rustc_parse::parser::Parser;
 use syntax::util::map_in_place::MapInPlace;
 use syntax::visit::{self, Visitor};
 
-use errors::{Applicability, FatalError, PResult};
 use smallvec::{smallvec, SmallVec};
-
-use rustc_data_structures::sync::Lrc;
 use std::io::ErrorKind;
 use std::ops::DerefMut;
 use std::path::PathBuf;
index feba7f633ed80c98fa8efee93f079feee8fb58c9..4fe7c268c4f0b47e90fe4e8911b9ec89990d734c 100644 (file)
@@ -13,7 +13,7 @@
 #[macro_export]
 macro_rules! panictry {
     ($e:expr) => {{
-        use errors::FatalError;
+        use rustc_errors::FatalError;
         use std::result::Result::{Err, Ok};
         match $e {
             Ok(e) => e,
index c0e34a30c54e99d3195cd0eeee225aa3f5124206..441c1b75a7c73e094c4999054d2dc352eb6d78ae 100644 (file)
@@ -85,7 +85,7 @@
 use syntax::token::{self, DocComment, Nonterminal, Token};
 use syntax::tokenstream::TokenStream;
 
-use errors::{FatalError, PResult};
+use rustc_errors::{FatalError, PResult};
 use rustc_span::Span;
 use smallvec::{smallvec, SmallVec};
 
index 6e965346d30e9bf7948bbebd0314317059f3568e..d72317af9eb67a956f89bf31f3e35f1fd7df0636 100644 (file)
@@ -8,6 +8,9 @@
 use crate::mbe::macro_parser::{MatchedNonterminal, MatchedSeq, NamedParseResult};
 use crate::mbe::transcribe::transcribe;
 
+use rustc_data_structures::fx::FxHashMap;
+use rustc_data_structures::sync::Lrc;
+use rustc_errors::{Applicability, DiagnosticBuilder, FatalError};
 use rustc_feature::Features;
 use rustc_parse::parser::Parser;
 use rustc_parse::Directory;
 use syntax::token::{self, NtTT, Token, TokenKind::*};
 use syntax::tokenstream::{DelimSpan, TokenStream};
 
-use errors::{DiagnosticBuilder, FatalError};
 use log::debug;
-
-use rustc_data_structures::fx::FxHashMap;
-use rustc_data_structures::sync::Lrc;
 use std::borrow::Cow;
 use std::collections::hash_map::Entry;
 use std::{mem, slice};
 
-use errors::Applicability;
-
 const VALID_FRAGMENT_NAMES_MSG: &str = "valid fragment specifiers are \
                                         `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `lifetime`, \
                                         `literal`, `path`, `meta`, `tt`, `item` and `vis`";
index 4fd68a80de81d275f535f473d95c9beeefda4ce0..104a5233c9d8c193dee36a7be0d802b837b8ddc1 100644 (file)
@@ -2,19 +2,17 @@
 use crate::mbe;
 use crate::mbe::macro_parser::{MatchedNonterminal, MatchedSeq, NamedMatch};
 
+use rustc_data_structures::fx::FxHashMap;
+use rustc_data_structures::sync::Lrc;
+use rustc_errors::pluralize;
+use rustc_span::hygiene::{ExpnId, Transparency};
+use rustc_span::Span;
 use syntax::ast::{Ident, Mac};
 use syntax::mut_visit::{self, MutVisitor};
 use syntax::token::{self, NtTT, Token};
 use syntax::tokenstream::{DelimSpan, TokenStream, TokenTree, TreeAndJoint};
 
 use smallvec::{smallvec, SmallVec};
-
-use errors::pluralize;
-use rustc_data_structures::fx::FxHashMap;
-use rustc_data_structures::sync::Lrc;
-use rustc_span::hygiene::{ExpnId, Transparency};
-use rustc_span::Span;
-
 use std::mem;
 
 // A Marker adds the given mark to the syntax context.
index 835f0b0108ead65a52d83799f7b8b268b5ae6feb..2ef81d80a1412062b41d95f279327425f571057f 100644 (file)
@@ -1,4 +1,5 @@
 use rustc_data_structures::sync::Lrc;
+use rustc_errors::{emitter::EmitterWriter, Handler};
 use rustc_parse::lexer::StringReader;
 use rustc_span::source_map::{FilePathMapping, SourceMap};
 use rustc_span::symbol::Symbol;
@@ -8,7 +9,6 @@
 use syntax::util::comments::is_doc_comment;
 use syntax::with_default_globals;
 
-use errors::{emitter::EmitterWriter, Handler};
 use std::io;
 use std::path::PathBuf;
 
index 25cd5dabe57ec3e45adb304a2e0baa0952cde513..b79e2894126dd8d8954403c7713558f5d36270cb 100644 (file)
@@ -1,6 +1,6 @@
 use crate::tests::{matches_codepattern, string_to_stream, with_error_checking_parse};
 
-use errors::PResult;
+use rustc_errors::PResult;
 use rustc_parse::new_parser_from_source_str;
 use rustc_span::source_map::FilePathMapping;
 use rustc_span::symbol::{kw, sym, Symbol};
index 25e2bbb34678e344ae26297e0a397b531fd50c75..cb6249e936976e8ba5399fd256a5ba8c657a22a5 100644 (file)
@@ -1,15 +1,14 @@
 use crate::base::{self, *};
 use crate::proc_macro_server;
 
+use rustc_data_structures::sync::Lrc;
+use rustc_errors::{Applicability, FatalError};
 use rustc_span::symbol::sym;
+use rustc_span::{Span, DUMMY_SP};
 use syntax::ast::{self, ItemKind, MetaItemKind, NestedMetaItem};
-use syntax::errors::{Applicability, FatalError};
 use syntax::token;
 use syntax::tokenstream::{self, TokenStream};
 
-use rustc_data_structures::sync::Lrc;
-use rustc_span::{Span, DUMMY_SP};
-
 const EXEC_STRATEGY: pm::bridge::server::SameThread = pm::bridge::server::SameThread;
 
 pub struct BangProcMacro {
index cf5749f506856b065bfd9d0bf46bc594710dcdb6..d441613ac58f4f702ab46bd9b8af281fa053de00 100644 (file)
@@ -1,5 +1,7 @@
 use crate::base::ExtCtxt;
 
+use rustc_data_structures::sync::Lrc;
+use rustc_errors::Diagnostic;
 use rustc_parse::lexer::nfc_normalize;
 use rustc_parse::{nt_to_tokenstream, parse_stream_from_source_str};
 use rustc_span::symbol::{kw, sym, Symbol};
@@ -11,9 +13,6 @@
 use syntax::tokenstream::{self, DelimSpan, IsJoint::*, TokenStream, TreeAndJoint};
 use syntax::util::comments;
 
-use errors::Diagnostic;
-use rustc_data_structures::sync::Lrc;
-
 use pm::bridge::{server, TokenTree};
 use pm::{Delimiter, Level, LineColumn, Spacing};
 use std::ops::Bound;
@@ -265,13 +264,13 @@ fn to_internal(self) -> TokenStream {
     }
 }
 
-impl ToInternal<errors::Level> for Level {
-    fn to_internal(self) -> errors::Level {
+impl ToInternal<rustc_errors::Level> for Level {
+    fn to_internal(self) -> rustc_errors::Level {
         match self {
-            Level::Error => errors::Level::Error,
-            Level::Warning => errors::Level::Warning,
-            Level::Note => errors::Level::Note,
-            Level::Help => errors::Level::Help,
+            Level::Error => rustc_errors::Level::Error,
+            Level::Warning => rustc_errors::Level::Warning,
+            Level::Note => rustc_errors::Level::Note,
+            Level::Help => rustc_errors::Level::Help,
             _ => unreachable!("unknown proc_macro::Level variant: {:?}", self),
         }
     }
index 18dc605c9e754003e5564d7eeefa39cff919a473..82ab74ac1500493ee5040cc30d553e08e33e9a3f 100644 (file)
@@ -6,9 +6,9 @@
 use syntax::tokenstream::TokenStream;
 use syntax::with_default_globals;
 
-use errors::emitter::EmitterWriter;
-use errors::{Handler, PResult};
 use rustc_data_structures::sync::Lrc;
+use rustc_errors::emitter::EmitterWriter;
+use rustc_errors::{Handler, PResult};
 
 use std::io;
 use std::io::prelude::*;
index 5ca8fc97ac422aa06c95a907acdd3531c95b44bd..7e23e70577975cdb9e3e90ee0625fad8ac2387ed 100644 (file)
@@ -12,6 +12,7 @@ path = "lib.rs"
 log = "0.4"
 unicode-security = "0.0.2"
 rustc = { path = "../librustc" }
+rustc_errors = { path = "../librustc_errors" }
 rustc_hir = { path = "../librustc_hir" }
 rustc_target = { path = "../librustc_target" }
 syntax = { path = "../libsyntax" }
index 46202cda16d50aefc7786c487db42092cd669d5f..d8ddf7435b458358e49c55b11d9284b1e364e709 100644 (file)
@@ -2,9 +2,9 @@
 use rustc::lint::FutureIncompatibleInfo;
 use rustc::ty;
 use rustc::ty::adjustment::{Adjust, Adjustment};
+use rustc_errors::Applicability;
 use rustc_hir as hir;
 use rustc_span::symbol::sym;
-use syntax::errors::Applicability;
 
 declare_lint! {
     pub ARRAY_INTO_ITER,
index c8a595267569eeea62a55e6fdbd359e5d418267f..25f6361e0507d995ee26edfbd60fab582a95f271 100644 (file)
@@ -31,6 +31,7 @@
 use rustc::traits::misc::can_type_implement_copy;
 use rustc::ty::{self, layout::VariantIdx, Ty, TyCtxt};
 use rustc_data_structures::fx::FxHashSet;
+use rustc_errors::{Applicability, DiagnosticBuilder};
 use rustc_feature::Stability;
 use rustc_feature::{deprecated_attributes, AttributeGate, AttributeTemplate, AttributeType};
 use rustc_hir as hir;
@@ -44,7 +45,6 @@
 use rustc_span::{BytePos, Span};
 use syntax::ast::{self, Expr};
 use syntax::attr::{self, HasAttrs};
-use syntax::errors::{Applicability, DiagnosticBuilder};
 use syntax::print::pprust::{self, expr_to_string};
 use syntax::tokenstream::{TokenStream, TokenTree};
 use syntax::visit::FnKind;
index 13e57ecf1469c4a59de3437b786bd90b903ae92a..7e5ad0976989ecd765f3138205586e71867449c1 100644 (file)
@@ -2,6 +2,7 @@
 use lint::{EarlyLintPass, LateLintPass, LintPass};
 use rustc::lint;
 use rustc::ty;
+use rustc_errors::Applicability;
 use rustc_hir as hir;
 use rustc_hir::def::{DefKind, Res};
 use rustc_hir::intravisit::FnKind;
@@ -11,7 +12,6 @@
 use rustc_target::spec::abi::Abi;
 use syntax::ast;
 use syntax::attr;
-use syntax::errors::Applicability;
 
 #[derive(PartialEq)]
 pub enum MethodLateContext {
index 8dbf96a155825dd78956825dbe5b1306c944aa1b..9fc147f2a0c5afeebd7343f4d223ad5582bd8c49 100644 (file)
@@ -1,6 +1,6 @@
 use crate::lint::{EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass};
+use rustc_errors::Applicability;
 use syntax::ast::{ExprKind, Stmt, StmtKind};
-use syntax::errors::Applicability;
 
 declare_lint! {
     pub REDUNDANT_SEMICOLON,
index f740bdb2716194ed3d983513e2738da9e994a118..f128e25f35bf25adc23d645d944c723e04decd92 100644 (file)
@@ -9,6 +9,7 @@
 use rustc::ty::subst::SubstsRef;
 use rustc::ty::{self, AdtKind, ParamEnv, Ty, TyCtxt};
 use rustc_data_structures::fx::FxHashSet;
+use rustc_errors::Applicability;
 use rustc_hir as hir;
 use rustc_hir::{is_range_literal, ExprKind, Node};
 use rustc_index::vec::Idx;
@@ -16,7 +17,6 @@
 use rustc_span::symbol::sym;
 use rustc_span::Span;
 use rustc_target::spec::abi::Abi;
-use syntax::errors::Applicability;
 use syntax::{ast, attr};
 
 use log::debug;
index 184651e3ad5649286c128466e959fb27120af509..d57f565d919be9341053e476160a9914359edb04 100644 (file)
@@ -5,17 +5,16 @@
 use rustc::ty::adjustment;
 use rustc::ty::{self, Ty};
 use rustc_data_structures::fx::FxHashMap;
+use rustc_errors::{pluralize, Applicability};
 use rustc_feature::{AttributeType, BuiltinAttribute, BUILTIN_ATTRIBUTE_MAP};
 use rustc_hir as hir;
 use rustc_hir::def::{DefKind, Res};
 use rustc_hir::def_id::DefId;
-
 use rustc_span::symbol::Symbol;
 use rustc_span::symbol::{kw, sym};
 use rustc_span::{BytePos, Span};
 use syntax::ast;
 use syntax::attr;
-use syntax::errors::{pluralize, Applicability};
 use syntax::print::pprust;
 use syntax::util::parser;
 
index d998e82d4890b03dc5acc6a1a9f2abfb46b3c651..48767c377a94c7d40df21dad8e792bd31385504d 100644 (file)
@@ -16,8 +16,8 @@ memmap = "0.7"
 smallvec = { version = "1.0", features = ["union", "may_dangle"] }
 rustc = { path = "../librustc" }
 rustc_data_structures = { path = "../librustc_data_structures" }
+rustc_errors = { path = "../librustc_errors" }
 rustc_hir = { path = "../librustc_hir" }
-errors = { path = "../librustc_errors", package = "rustc_errors" }
 rustc_target = { path = "../librustc_target" }
 rustc_index = { path = "../librustc_index" }
 rustc_serialize = { path = "../libserialize", package = "serialize" }
index 30d049d143eabc576d5ea4af9f3399bd36019565..17c2e3303cb56986bfb5befc70ad9a0785953f43 100644 (file)
 use rustc::ty::TyCtxt;
 use rustc_data_structures::svh::Svh;
 use rustc_data_structures::sync::Lrc;
+use rustc_error_codes::*;
+use rustc_errors::struct_span_err;
+use rustc_expand::base::SyntaxExtension;
 use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
 use rustc_index::vec::IndexVec;
-use rustc_target::spec::{PanicStrategy, TargetTriple};
-
-use std::path::Path;
-use std::{cmp, fs};
-
-use errors::struct_span_err;
-use log::{debug, info, log_enabled};
-use proc_macro::bridge::client::ProcMacro;
-use rustc_expand::base::SyntaxExtension;
 use rustc_span::edition::Edition;
 use rustc_span::symbol::{sym, Symbol};
 use rustc_span::{Span, DUMMY_SP};
+use rustc_target::spec::{PanicStrategy, TargetTriple};
 use syntax::ast;
 use syntax::attr;
 use syntax::expand::allocator::{global_allocator_spans, AllocatorKind};
 
-use rustc_error_codes::*;
+use log::{debug, info, log_enabled};
+use proc_macro::bridge::client::ProcMacro;
+use std::path::Path;
+use std::{cmp, fs};
 
 #[derive(Clone)]
 pub struct CStore {
index 9f9a2187eced8c863903542569a4680949a93e3a..4745ad02a3aa4adcb10b0db6f3a8d7362e815a93 100644 (file)
 use crate::creader::Library;
 use crate::rmeta::{rustc_version, MetadataBlob, METADATA_HEADER};
 
-use errors::{struct_span_err, DiagnosticBuilder};
 use rustc::middle::cstore::{CrateSource, MetadataLoader};
 use rustc::session::filesearch::{FileDoesntMatch, FileMatches, FileSearch};
 use rustc::session::search_paths::PathKind;
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
 use rustc_data_structures::svh::Svh;
 use rustc_data_structures::sync::MetadataRef;
+use rustc_errors::{struct_span_err, DiagnosticBuilder};
 use rustc_span::symbol::{sym, Symbol};
 use rustc_span::Span;
 use rustc_target::spec::{Target, TargetTriple};
index c9f47475af851afd979b048848997602d0f03a9e..ae67efb966c960b36250550c9c2a5929646ca361 100644 (file)
@@ -1,9 +1,9 @@
-use errors::struct_span_err;
 use rustc::middle::cstore::{self, NativeLibrary};
 use rustc::session::Session;
 use rustc::ty::TyCtxt;
 use rustc_data_structures::fx::FxHashSet;
 use rustc_error_codes::*;
+use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::itemlikevisit::ItemLikeVisitor;
 use rustc_span::source_map::Span;
index 9a301a6ad32a81a36a9d33a28519bbba38a837b3..dc63fa80275e1994d242d35b121bc562092f9074 100644 (file)
@@ -6,13 +6,12 @@
 };
 use rustc::mir::{Body, ConstraintCategory, Location};
 use rustc::ty::{self, RegionVid, Ty};
-use rustc_errors::DiagnosticBuilder;
+use rustc_errors::{Applicability, DiagnosticBuilder};
 use rustc_hir::def_id::DefId;
 use rustc_index::vec::IndexVec;
 use rustc_span::symbol::kw;
 use rustc_span::Span;
 use std::collections::VecDeque;
-use syntax::errors::Applicability;
 
 use crate::util::borrowck_errors;
 
index 151c63a49b57c497af98398cd44cf43fd94c33d4..88762dabd8a290610742fa8f3b0341e4a512f406 100644 (file)
@@ -3,11 +3,10 @@
 use std::iter::once;
 use std::ops::Range;
 
+use rustc_errors::{Applicability, Handler};
 use rustc_lexer::unescape::{EscapeError, Mode};
 use rustc_span::{BytePos, Span};
 
-use syntax::errors::{Applicability, Handler};
-
 pub(crate) fn emit_unescape_error(
     handler: &Handler,
     // interior part of the literal, without quotes
index ced933ba3ee4228e7e7f2234b4a7da6d0795fca6..4adc6dabb9fdbaf7a403452ce0caff637b2ff129 100644 (file)
@@ -12,6 +12,7 @@ path = "lib.rs"
 log = "0.4"
 rustc = { path = "../librustc" }
 rustc_data_structures = { path = "../librustc_data_structures" }
+rustc_errors = { path = "../librustc_errors" }
 rustc_feature = { path = "../librustc_feature" }
 rustc_hir = { path = "../librustc_hir" }
 rustc_index = { path = "../librustc_index" }
@@ -19,5 +20,4 @@ rustc_parse = { path = "../librustc_parse" }
 rustc_target = { path = "../librustc_target" }
 syntax = { path = "../libsyntax" }
 rustc_span = { path = "../librustc_span" }
-errors = { path = "../librustc_errors", package = "rustc_errors" }
 rustc_error_codes = { path = "../librustc_error_codes" }
index 43c997d34e160ea178faa275b0f1271187a71cbc..be58a790fa8786c5084ce2029b9b0c1d7f3785fa 100644 (file)
@@ -6,10 +6,10 @@
 // This pass is supposed to perform only simple checks not requiring name resolution
 // or type checking or some other kind of complex analysis.
 
-use errors::{struct_span_err, Applicability, FatalError};
 use rustc::lint;
 use rustc::session::Session;
 use rustc_data_structures::fx::FxHashMap;
+use rustc_errors::{struct_span_err, Applicability, FatalError};
 use rustc_parse::validate_attr;
 use rustc_span::source_map::Spanned;
 use rustc_span::symbol::{kw, sym};
@@ -158,7 +158,7 @@ fn walk_ty(&mut self, t: &'a Ty) {
         }
     }
 
-    fn err_handler(&self) -> &errors::Handler {
+    fn err_handler(&self) -> &rustc_errors::Handler {
         &self.session.diagnostic()
     }
 
@@ -409,7 +409,7 @@ enum GenericPosition {
 
 fn validate_generics_order<'a>(
     sess: &Session,
-    handler: &errors::Handler,
+    handler: &rustc_errors::Handler,
     generics: impl Iterator<Item = (ParamKindOrd, Option<&'a [GenericBound]>, Span, Option<String>)>,
     pos: GenericPosition,
     span: Span,
index 47e6e5ccc24fe2cc6666c419a8cb6da4b352c2f5..a2944918a4748fca3e4a696d34b6cd6e672d48f0 100644 (file)
@@ -7,12 +7,12 @@
 //! 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 errors::struct_span_err;
 use rustc::hir::map::Map;
 use rustc::session::config::nightly_options;
 use rustc::ty::query::Providers;
 use rustc::ty::TyCtxt;
 use rustc_error_codes::*;
+use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::def_id::DefId;
 use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
index 8273504715dba99f38adcd44c381fa2216ff617f..028d7c662758a4adf87b3dd69c2e94d8851e7fd4 100644 (file)
@@ -1,9 +1,9 @@
-use errors::struct_span_err;
 use rustc::hir::map as hir_map;
 use rustc::session::config::EntryFnType;
 use rustc::session::{config, Session};
 use rustc::ty::query::Providers;
 use rustc::ty::TyCtxt;
+use rustc_errors::struct_span_err;
 use rustc_hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
 use rustc_hir::itemlikevisit::ItemLikeVisitor;
 use rustc_hir::{HirId, ImplItem, Item, ItemKind, TraitItem};
index ae8ac2e2c2e358ea601797ecc2799d5454ad24d2..2c26707a518508da0e5bee0e374855f9f302f8e8 100644 (file)
@@ -1,8 +1,8 @@
-use errors::struct_span_err;
 use rustc::hir::map::Map;
 use rustc::ty::layout::{LayoutError, Pointer, SizeSkeleton, VariantIdx};
 use rustc::ty::query::Providers;
 use rustc::ty::{self, Ty, TyCtxt};
+use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::def::{DefKind, Res};
 use rustc_hir::def_id::DefId;
index e7d490d6d8ddbe332f811d4a067f802d443a3f1b..8ae729128978655b9268599607bc97a8960b800d 100644 (file)
@@ -4,11 +4,11 @@
 // and `#[unstable (..)]`), but are not declared in one single location
 // (unlike lang features), which means we need to collect them instead.
 
-use errors::struct_span_err;
 use rustc::hir::map::Map;
 use rustc::middle::lib_features::LibFeatures;
 use rustc::ty::query::Providers;
 use rustc::ty::TyCtxt;
+use rustc_errors::struct_span_err;
 use rustc_hir::def_id::LOCAL_CRATE;
 use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
 use rustc_span::symbol::Symbol;
index 5c1bc4d1eaa87f1d5babe8111e741579547bd9fa..0426f3fbea23600133eac6fa68623a9a4f4cf1b9 100644 (file)
 use self::LiveNodeKind::*;
 use self::VarKind::*;
 
-use errors::Applicability;
 use rustc::hir::map::Map;
 use rustc::lint;
 use rustc::ty::query::Providers;
 use rustc::ty::{self, TyCtxt};
 use rustc_data_structures::fx::FxIndexMap;
+use rustc_errors::Applicability;
 use rustc_hir as hir;
 use rustc_hir::def::*;
 use rustc_hir::def_id::DefId;
@@ -1064,7 +1064,7 @@ fn propagate_through_expr(&mut self, expr: &Expr<'_>, succ: LiveNode) -> LiveNod
                             .sess
                             .struct_span_err(expr.span, "`break` to unknown label")
                             .emit();
-                        errors::FatalError.raise()
+                        rustc_errors::FatalError.raise()
                     }
                 }
             }
index 333b39c3bb30277027d2d26260bd5cdfe41e2d58..5ad5795c777d48bee1c011cc0abacfd4d7b9a369 100644 (file)
@@ -2,10 +2,10 @@
 
 use rustc::session::Session;
 
-use errors::{struct_span_err, Applicability};
 use rustc::hir::map::Map;
 use rustc::ty::query::Providers;
 use rustc::ty::TyCtxt;
+use rustc_errors::{struct_span_err, Applicability};
 use rustc_hir as hir;
 use rustc_hir::def_id::DefId;
 use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
index be098543a2ff2cb837c2e500b66f7b029465de8d..588386e6f8d6912e4d10e8794c4b08778e42ca04 100644 (file)
@@ -1,7 +1,6 @@
 //! A pass that annotates every item and method with its stability level,
 //! propagating default levels lexically from parent to children ast nodes.
 
-use errors::struct_span_err;
 use rustc::hir::map::Map;
 use rustc::lint;
 use rustc::middle::privacy::AccessLevels;
@@ -11,6 +10,7 @@
 use rustc::ty::query::Providers;
 use rustc::ty::TyCtxt;
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
+use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::def::{DefKind, Res};
 use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
index 01e5d75d2b57d5697d97b7f51dbe47baeb158e20..af37e7b5b76ac5132918f256ba415cc0d2197a42 100644 (file)
@@ -14,16 +14,16 @@ doctest = false
 bitflags = "1.2.1"
 log = "0.4"
 syntax = { path = "../libsyntax" }
-rustc_expand = { path = "../librustc_expand" }
 arena = { path = "../libarena" }
-errors = { path = "../librustc_errors", package = "rustc_errors" }
-rustc_span = { path = "../librustc_span" }
 rustc = { path = "../librustc" }
 rustc_ast_lowering = { path = "../librustc_ast_lowering" }
 rustc_data_structures = { path = "../librustc_data_structures" }
+rustc_errors = { path = "../librustc_errors" }
+rustc_expand = { path = "../librustc_expand" }
 rustc_feature = { path = "../librustc_feature" }
 rustc_hir = { path = "../librustc_hir" }
 rustc_metadata = { path = "../librustc_metadata" }
 rustc_error_codes = { path = "../librustc_error_codes" }
 rustc_session = { path = "../librustc_session" }
+rustc_span = { path = "../librustc_span" }
 smallvec = { version = "1.0", features = ["union", "may_dangle"] }
index 6472f39e844a19e29ae65815d32ff64af13b7a33..291386413d647e898ac38a7210c63ed67d5486c0 100644 (file)
 use rustc::hir::exports::Export;
 use rustc::middle::cstore::CrateStore;
 use rustc::ty;
-use rustc_hir::def::{self, *};
-use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
-use rustc_metadata::creader::LoadedMacro;
-
 use rustc_data_structures::sync::Lrc;
-use std::cell::Cell;
-use std::ptr;
-
-use errors::{struct_span_err, Applicability};
-
+use rustc_error_codes::*;
+use rustc_errors::{struct_span_err, Applicability};
 use rustc_expand::base::SyntaxExtension;
 use rustc_expand::expand::AstFragment;
+use rustc_hir::def::{self, *};
+use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
+use rustc_metadata::creader::LoadedMacro;
 use rustc_span::hygiene::{ExpnId, MacroKind};
 use rustc_span::source_map::{respan, Spanned};
 use rustc_span::symbol::{kw, sym};
@@ -44,8 +40,8 @@
 use syntax::visit::{self, Visitor};
 
 use log::debug;
-
-use rustc_error_codes::*;
+use std::cell::Cell;
+use std::ptr;
 
 type Res = def::Res<NodeId>;
 
index 6561072a21bcee699e102c6d779067a17b06e75a..d6f365fce7929339c20715a12ffdd514d973acb4 100644 (file)
@@ -26,9 +26,9 @@
 use crate::imports::ImportDirectiveSubclass;
 use crate::Resolver;
 
-use errors::pluralize;
 use rustc::{lint, ty};
 use rustc_data_structures::fx::FxHashSet;
+use rustc_errors::pluralize;
 use rustc_session::node_id::NodeMap;
 use rustc_span::{MultiSpan, Span, DUMMY_SP};
 use syntax::ast;
index b81e71f0acfd7525ca1df09a538d5c4aaa4efc47..994280490938009c65a7ef6799809e2d8a7a903c 100644 (file)
@@ -1,11 +1,11 @@
 use std::cmp::Reverse;
 
-use errors::{struct_span_err, Applicability, DiagnosticBuilder};
 use log::debug;
 use rustc::bug;
 use rustc::session::Session;
 use rustc::ty::{self, DefIdTree};
 use rustc_data_structures::fx::FxHashSet;
+use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder};
 use rustc_feature::BUILTIN_ATTRIBUTES;
 use rustc_hir::def::Namespace::{self, *};
 use rustc_hir::def::{self, DefKind, NonMacroAttrKind};
index 72de895f350f83ac139b3481662b54c7aafa3b84..813e6ac96911e9c6270017ba2b4016dd0f2dba6c 100644 (file)
@@ -11,7 +11,6 @@
 use crate::{CrateLint, Module, ModuleOrUniformRoot, ParentScope, PerNS, ScopeSet, Weak};
 use crate::{NameBinding, NameBindingKind, PathResult, PrivacyError, ToNameBinding};
 
-use errors::{pluralize, struct_span_err, Applicability};
 use rustc::hir::exports::Export;
 use rustc::lint::builtin::BuiltinLintDiagnostics;
 use rustc::lint::builtin::{PUB_USE_OF_PRIVATE_EXTERN_CRATE, UNUSED_IMPORTS};
@@ -20,6 +19,7 @@
 use rustc::{bug, span_bug};
 use rustc_data_structures::fx::FxHashSet;
 use rustc_data_structures::ptr_key::PtrKey;
+use rustc_errors::{pluralize, struct_span_err, Applicability};
 use rustc_hir::def::{self, PartialRes};
 use rustc_hir::def_id::DefId;
 use rustc_span::hygiene::ExpnId;
index 29a1be6bb7461e72edb315686530e28a51f12d12..defca4944bcd819fac9dbadbf9120b8fbeb36ba9 100644 (file)
 use crate::{Module, ModuleOrUniformRoot, NameBindingKind, ParentScope, PathResult};
 use crate::{ResolutionError, Resolver, Segment, UseError};
 
-use errors::DiagnosticId;
-use log::debug;
 use rustc::{bug, lint, span_bug};
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
+use rustc_errors::DiagnosticId;
 use rustc_hir::def::Namespace::{self, *};
 use rustc_hir::def::{self, CtorKind, DefKind, PartialRes, PerNS};
 use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX};
@@ -28,6 +27,7 @@
 use syntax::visit::{self, FnKind, Visitor};
 use syntax::{unwrap_or, walk_list};
 
+use log::debug;
 use std::collections::BTreeSet;
 use std::mem::replace;
 
@@ -306,7 +306,7 @@ fn descr_expected(self) -> &'static str {
     }
 
     fn error_code(self, has_unexpected_resolution: bool) -> DiagnosticId {
-        use errors::error_code;
+        use rustc_errors::error_code;
         match (self, has_unexpected_resolution) {
             (PathSource::Trait(_), true) => error_code!(E0404),
             (PathSource::Trait(_), false) => error_code!(E0405),
index 029f8421475e574268c4f34d9ec52078fa6dc9c7..151f3e834e5de83c59307d6630a0722b9a3db2e8 100644 (file)
@@ -4,10 +4,10 @@
 use crate::{CrateLint, Module, ModuleKind, ModuleOrUniformRoot};
 use crate::{PathResult, PathSource, Segment};
 
-use errors::{Applicability, DiagnosticBuilder};
-use log::debug;
 use rustc::session::config::nightly_options;
 use rustc_data_structures::fx::FxHashSet;
+use rustc_error_codes::*;
+use rustc_errors::{Applicability, DiagnosticBuilder};
 use rustc_hir::def::Namespace::{self, *};
 use rustc_hir::def::{self, CtorKind, DefKind};
 use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX};
@@ -18,7 +18,7 @@
 use syntax::ast::{self, Expr, ExprKind, Ident, NodeId, Path, Ty, TyKind};
 use syntax::util::lev_distance::find_best_match_for_name;
 
-use rustc_error_codes::*;
+use log::debug;
 
 type Res = def::Res<ast::NodeId>;
 
@@ -139,7 +139,7 @@ pub(crate) fn smart_resolve_report_errors(
 
         // Emit special messages for unresolved `Self` and `self`.
         if is_self_type(path, ns) {
-            err.code(errors::error_code!(E0411));
+            err.code(rustc_errors::error_code!(E0411));
             err.span_label(
                 span,
                 format!("`Self` is only available in impls, traits, and type definitions"),
@@ -149,7 +149,7 @@ pub(crate) fn smart_resolve_report_errors(
         if is_self_value(path, ns) {
             debug!("smart_resolve_path_fragment: E0424, source={:?}", source);
 
-            err.code(errors::error_code!(E0424));
+            err.code(rustc_errors::error_code!(E0424));
             err.span_label(span, match source {
                 PathSource::Pat => format!(
                     "`self` value is a keyword and may not be bound to variables or shadowed",
index 9e4486e16f2ccb0a716ce8c7570f7b6c54e220da..e6be9f6d328c09f93d9a88033d477493b8b80613 100644 (file)
@@ -20,7 +20,6 @@
 
 use Determinacy::*;
 
-use errors::{struct_span_err, Applicability, DiagnosticBuilder};
 use rustc::hir::exports::ExportMap;
 use rustc::hir::map::{DefKey, Definitions};
 use rustc::lint;
@@ -32,6 +31,7 @@
 use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
 use rustc_data_structures::ptr_key::PtrKey;
 use rustc_data_structures::sync::Lrc;
+use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder};
 use rustc_expand::base::SyntaxExtension;
 use rustc_hir::def::Namespace::*;
 use rustc_hir::def::{self, CtorKind, CtorOf, DefKind, NonMacroAttrKind, PartialRes};
index 469e1b9aa62077e3c2be9a32eb03b8afb930b765..d6143eec73c00f3e7d22d16c4443fd4754b1a37d 100644 (file)
@@ -5,7 +5,6 @@
 //! used between functions, and they operate in a purely top-down
 //! way. Therefore, we break lifetime name resolution into a separate pass.
 
-use errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder};
 use rustc::hir::map::Map;
 use rustc::lint;
 use rustc::middle::resolve_lifetime::*;
@@ -13,6 +12,7 @@
 use rustc::ty::{self, DefIdTree, GenericParamDefKind, TyCtxt};
 use rustc::{bug, span_bug};
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
+use rustc_errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder};
 use rustc_hir as hir;
 use rustc_hir::def::{DefKind, Res};
 use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LocalDefId, LOCAL_CRATE};
index a489d0cd02b40045b1bff629ae98ccabe876c57a..84e5f56d9c208456ee22139fc78073a91a8fa71a 100644 (file)
@@ -15,8 +15,8 @@ arena = { path = "../libarena" }
 log = "0.4"
 rustc = { path = "../librustc" }
 rustc_data_structures = { path = "../librustc_data_structures" }
+rustc_errors = { path = "../librustc_errors" }
 rustc_hir = { path = "../librustc_hir" }
-errors = { path = "../librustc_errors", package = "rustc_errors" }
 rustc_target = { path = "../librustc_target" }
 smallvec = { version = "1.0", features = ["union", "may_dangle"] }
 syntax = { path = "../libsyntax" }
index 46b996e09302bf83d4938d886f6c807267f0d005..851c2f76adab7f310d126ac62a7e32cd2925dd55 100644 (file)
@@ -9,7 +9,6 @@
 use crate::namespace::Namespace;
 use crate::require_c_abi_if_c_variadic;
 use crate::util::common::ErrorReported;
-use errors::{struct_span_err, Applicability, DiagnosticId};
 use rustc::lint::builtin::AMBIGUOUS_ASSOCIATED_ITEMS;
 use rustc::traits;
 use rustc::traits::astconv_object_safety_violations;
@@ -19,6 +18,7 @@
 use rustc::ty::{self, Const, DefIdTree, ToPredicate, Ty, TyCtxt, TypeFoldable};
 use rustc::ty::{GenericParamDef, GenericParamDefKind};
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
+use rustc_errors::{pluralize, struct_span_err, Applicability, DiagnosticId};
 use rustc_hir as hir;
 use rustc_hir::def::{CtorOf, DefKind, Res};
 use rustc_hir::def_id::DefId;
@@ -30,7 +30,6 @@
 use rustc_target::spec::abi;
 use smallvec::SmallVec;
 use syntax::ast;
-use syntax::errors::pluralize;
 use syntax::feature_gate::feature_err;
 use syntax::util::lev_distance::find_best_match_for_name;
 
index 3d02889d2ddd3175c8dd1229d1ff9eb7425f454d..8d6b74c3015c93772984a84e1e7e0b79d73489db 100644 (file)
@@ -1,13 +1,13 @@
 use super::method::MethodCallee;
 use super::{FnCtxt, Needs, PlaceOp};
 
-use errors::struct_span_err;
 use rustc::infer::{InferCtxt, InferOk};
 use rustc::session::DiagnosticMessageId;
 use rustc::traits::{self, TraitEngine};
 use rustc::ty::adjustment::{Adjust, Adjustment, OverloadedDeref};
 use rustc::ty::{self, TraitRef, Ty, TyCtxt};
 use rustc::ty::{ToPredicate, TypeFoldable};
+use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 
 use rustc_span::Span;
index a1915bc025f79b46282a40dee1e852c32ce33a42..bff6765314ab83ea4254d6ab0aadeb93a52391be 100644 (file)
@@ -3,22 +3,20 @@
 use super::{Expectation, FnCtxt, Needs, TupleArgumentsFlag};
 use crate::type_error_struct;
 
-use errors::{struct_span_err, Applicability, DiagnosticBuilder};
-use hir::def::Res;
-use hir::def_id::{DefId, LOCAL_CRATE};
 use rustc::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
 use rustc::ty::adjustment::{Adjust, Adjustment, AllowTwoPhase, AutoBorrow, AutoBorrowMutability};
 use rustc::ty::subst::SubstsRef;
 use rustc::ty::{self, Ty, TyCtxt, TypeFoldable};
 use rustc::{infer, traits};
+use rustc_error_codes::*;
+use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder};
+use rustc_hir as hir;
+use rustc_hir::def::Res;
+use rustc_hir::def_id::{DefId, LOCAL_CRATE};
 use rustc_span::Span;
 use rustc_target::spec::abi;
 use syntax::ast::Ident;
 
-use rustc_hir as hir;
-
-use rustc_error_codes::*;
-
 /// Checks that it is legal to call methods of the trait corresponding
 /// to `trait_id` (this only cares about the trait, not the specific
 /// method that is called).
index 9dbf55c4948316c14dcdc97ae2da9b8cbc95a105..ba5e5fd8ac188dddf73300adb42993d9f649b6d0 100644 (file)
@@ -34,7 +34,6 @@
 use crate::lint;
 use crate::type_error_struct;
 use crate::util::common::ErrorReported;
-use errors::{struct_span_err, Applicability, DiagnosticBuilder};
 use rustc::middle::lang_items;
 use rustc::session::Session;
 use rustc::traits;
@@ -45,6 +44,7 @@
 use rustc::ty::error::TypeError;
 use rustc::ty::subst::SubstsRef;
 use rustc::ty::{self, Ty, TypeAndMut, TypeFoldable};
+use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder};
 use rustc_hir as hir;
 use rustc_span::Span;
 use syntax::ast;
index ec298ca697183b4b0182ff85fb62918c0bd8ec6e..feab31523f2659f0128357a3df9b890dbd9d69c4 100644 (file)
@@ -51,7 +51,6 @@
 //! we may want to adjust precisely when coercions occur.
 
 use crate::check::{FnCtxt, Needs};
-use errors::{struct_span_err, DiagnosticBuilder};
 use rustc::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
 use rustc::infer::{Coercion, InferOk, InferResult};
 use rustc::traits::{self, ObligationCause, ObligationCauseCode};
@@ -63,6 +62,7 @@
 use rustc::ty::relate::RelateResult;
 use rustc::ty::subst::SubstsRef;
 use rustc::ty::{self, Ty, TypeAndMut};
+use rustc_errors::{struct_span_err, DiagnosticBuilder};
 use rustc_hir as hir;
 use rustc_hir::def_id::DefId;
 use rustc_span;
index 449c2e90ff202cb1d224f51f03eb6d6288eeb5c0..c35661ac649fc8e70e2d017c2929fcdf8bb7ac6f 100644 (file)
@@ -1,4 +1,3 @@
-use errors::{pluralize, struct_span_err, Applicability, DiagnosticId};
 use rustc::hir::map::Map;
 use rustc::infer::{self, InferOk};
 use rustc::traits::{self, ObligationCause, ObligationCauseCode, Reveal};
@@ -7,6 +6,7 @@
 use rustc::ty::util::ExplicitSelf;
 use rustc::ty::{self, GenericParamDefKind, TyCtxt};
 use rustc::util::common::ErrorReported;
+use rustc_errors::{pluralize, struct_span_err, Applicability, DiagnosticId};
 use rustc_hir as hir;
 use rustc_hir::def::{DefKind, Res};
 use rustc_hir::intravisit;
index 1be65b5f1894bc3afa18174fcc90129482963a83..e0f9fcc69325c1a91921f69ae40612472ae96e97 100644 (file)
@@ -2,9 +2,9 @@
 use rustc::infer::InferOk;
 use rustc::traits::{self, ObligationCause};
 
-use errors::{Applicability, DiagnosticBuilder};
 use rustc::ty::adjustment::AllowTwoPhase;
 use rustc::ty::{self, AssocItem, Ty};
+use rustc_errors::{Applicability, DiagnosticBuilder};
 use rustc_hir as hir;
 use rustc_hir::{is_range_literal, print, Node};
 use rustc_span::symbol::sym;
index 33a07423c2502abc4d4ed9240df47c4bb72e7ddf..88e7a265ebbcf52ce1d8f3db502ed6b1a0ced97a 100644 (file)
@@ -2,7 +2,6 @@
 use crate::hir;
 use crate::hir::def_id::DefId;
 use crate::util::common::ErrorReported;
-use errors::struct_span_err;
 use rustc::infer::outlives::env::OutlivesEnvironment;
 use rustc::infer::{InferOk, SuppressRegionErrors};
 use rustc::middle::region;
@@ -11,6 +10,7 @@
 use rustc::ty::relate::{Relate, RelateResult, TypeRelation};
 use rustc::ty::subst::{Subst, SubstsRef};
 use rustc::ty::{self, Predicate, Ty, TyCtxt};
+use rustc_errors::struct_span_err;
 
 use rustc_span::Span;
 
index 01795ef39665f288f081b7d17a52823e2738a2db..35342de59a08254effd5be747367d83b03c02139 100644 (file)
@@ -17,7 +17,6 @@
 use crate::type_error_struct;
 use crate::util::common::ErrorReported;
 
-use errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder, DiagnosticId};
 use rustc::infer;
 use rustc::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
 use rustc::middle::lang_items;
@@ -28,6 +27,7 @@
 use rustc::ty::TypeFoldable;
 use rustc::ty::{AdtKind, Visibility};
 use rustc_data_structures::fx::FxHashMap;
+use rustc_errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder, DiagnosticId};
 use rustc_hir as hir;
 use rustc_hir::def::{CtorKind, DefKind, Res};
 use rustc_hir::def_id::DefId;
index 2b731947aa0fa8e0ecc79c74849f72b146b4a1ce..0441514c83c9d05e28fad6112ec13a7040e1fc99 100644 (file)
@@ -3,11 +3,11 @@
 
 use crate::require_same_types;
 
-use errors::struct_span_err;
 use rustc::traits::{ObligationCause, ObligationCauseCode};
 use rustc::ty::subst::Subst;
 use rustc::ty::{self, Ty, TyCtxt};
 use rustc_error_codes::*;
+use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_span::symbol::Symbol;
 use rustc_target::spec::abi::Abi;
index e9356a04c01d46d67170cec39d42ce559f06423b..711c285d17e88b1f2c6e38f0813bc807169a620d 100644 (file)
@@ -12,7 +12,6 @@
 
 use crate::check::FnCtxt;
 use crate::namespace::Namespace;
-use errors::{Applicability, DiagnosticBuilder};
 use rustc::infer::{self, InferOk};
 use rustc::traits;
 use rustc::ty::subst::Subst;
@@ -20,6 +19,7 @@
 use rustc::ty::GenericParamDefKind;
 use rustc::ty::{self, ToPolyTraitRef, ToPredicate, TraitRef, Ty, TypeFoldable};
 use rustc_data_structures::sync::Lrc;
+use rustc_errors::{Applicability, DiagnosticBuilder};
 use rustc_hir as hir;
 use rustc_hir::def::{CtorOf, DefKind};
 use rustc_hir::def_id::DefId;
index 4f0467b78b252a0c0cb70066a535e08a86e0aacb..b2542cc27a55119831ad054554313e39a0027f3f 100644 (file)
@@ -9,7 +9,6 @@
 use crate::hir::def_id::DefId;
 use crate::namespace::Namespace;
 
-use errors::struct_span_err;
 use rustc::infer::canonical::OriginalQueryValues;
 use rustc::infer::canonical::{Canonical, QueryResponse};
 use rustc::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
@@ -29,6 +28,7 @@
 };
 use rustc_data_structures::fx::FxHashSet;
 use rustc_data_structures::sync::Lrc;
+use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_span::{symbol::Symbol, Span, DUMMY_SP};
 use std::cmp::max;
index fb9cd2f50116311a25f9ccc03cc11431b7612946..b84e1d37b06ff489a674693bc970dcfc4755fa66 100644 (file)
@@ -4,7 +4,6 @@
 use crate::check::FnCtxt;
 use crate::middle::lang_items::FnOnceTraitLangItem;
 use crate::namespace::Namespace;
-use errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder};
 use rustc::hir::map as hir_map;
 use rustc::hir::map::Map;
 use rustc::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
@@ -12,6 +11,7 @@
 use rustc::ty::print::with_crate_prefix;
 use rustc::ty::{self, ToPolyTraitRef, ToPredicate, Ty, TyCtxt, TypeFoldable};
 use rustc_data_structures::fx::FxHashSet;
+use rustc_errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder};
 use rustc_hir as hir;
 use rustc_hir::def::{DefKind, Res};
 use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
index 5e73f8e3e128f0f03a24a07c8024f41977ae8e32..32225cd417f2d2494a2427f84319033b2eaa3fca 100644 (file)
@@ -90,7 +90,6 @@
 use crate::astconv::{AstConv, PathSeg};
 use crate::middle::lang_items;
 use crate::namespace::Namespace;
-use errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder, DiagnosticId};
 use rustc::hir::map::Map;
 use rustc::infer::canonical::{Canonical, OriginalQueryValues, QueryResponse};
 use rustc::infer::error_reporting::TypeAnnotationNeeded::E0282;
 };
 use rustc_data_structures::captures::Captures;
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
+use rustc_errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder, DiagnosticId};
 use rustc_hir as hir;
 use rustc_hir::def::{CtorOf, DefKind, Res};
 use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, DefIdSet, LOCAL_CRATE};
@@ -164,7 +164,7 @@ macro_rules! type_error_struct {
         if $typ.references_error() {
             $session.diagnostic().struct_dummy()
         } else {
-            errors::struct_span_err!($session, $span, $code, $($message)*)
+            rustc_errors::struct_span_err!($session, $span, $code, $($message)*)
         }
     })
 }
index d746b974727354127f1aec14ee22b46957660a9a..edf9d19dea37785ad58b35e6966d3878d4739dbc 100644 (file)
@@ -2,11 +2,11 @@
 
 use super::method::MethodCallee;
 use super::{FnCtxt, Needs};
-use errors::{self, struct_span_err, Applicability};
 use rustc::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
 use rustc::ty::adjustment::{Adjust, Adjustment, AllowTwoPhase, AutoBorrow, AutoBorrowMutability};
 use rustc::ty::TyKind::{Adt, Array, Char, FnDef, Never, Ref, Str, Tuple, Uint};
 use rustc::ty::{self, Ty, TypeFoldable};
+use rustc_errors::{self, struct_span_err, Applicability};
 use rustc_hir as hir;
 use rustc_span::Span;
 use syntax::ast::Ident;
@@ -279,7 +279,7 @@ fn check_overloaded_binop(
                                             lhs_expr.span,
                                             msg,
                                             format!("*{}", lstring),
-                                            errors::Applicability::MachineApplicable,
+                                            rustc_errors::Applicability::MachineApplicable,
                                         );
                                         suggested_deref = true;
                                     }
@@ -482,7 +482,7 @@ fn check_overloaded_binop(
     /// suggest calling the function. Returns wether a suggestion was given.
     fn add_type_neq_err_label(
         &self,
-        err: &mut errors::DiagnosticBuilder<'_>,
+        err: &mut rustc_errors::DiagnosticBuilder<'_>,
         span: Span,
         ty: Ty<'tcx>,
         other_ty: Ty<'tcx>,
@@ -565,7 +565,7 @@ fn check_str_addition(
         rhs_expr: &'tcx hir::Expr<'tcx>,
         lhs_ty: Ty<'tcx>,
         rhs_ty: Ty<'tcx>,
-        err: &mut errors::DiagnosticBuilder<'_>,
+        err: &mut rustc_errors::DiagnosticBuilder<'_>,
         is_assign: bool,
         op: hir::BinOp,
     ) -> bool {
index c2db165e29d1521ea842f8c1f267c805fad45c6b..1478b35a25ddc8785ff54d8f1b576ee4a5772e75 100644 (file)
@@ -1,11 +1,11 @@
 use crate::check::FnCtxt;
-use errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder};
 use rustc::infer;
 use rustc::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
 use rustc::traits::Pattern;
 use rustc::ty::subst::GenericArg;
 use rustc::ty::{self, BindingMode, Ty, TypeFoldable};
 use rustc_data_structures::fx::FxHashMap;
+use rustc_errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder};
 use rustc_hir as hir;
 use rustc_hir::def::{CtorKind, DefKind, Res};
 use rustc_hir::pat_util::EnumerateAndAdjustIterator;
index c57eb6721896424cde3380d22f9c8249815fabeb..df1eecdcfa8c5df8bb47ff025fa082ab16ac11a6 100644 (file)
@@ -1,13 +1,13 @@
 use crate::check::{FnCtxt, Inherited};
 use crate::constrained_generic_params::{identify_constrained_generic_params, Parameter};
 
-use errors::{struct_span_err, DiagnosticBuilder};
 use rustc::infer::opaque_types::may_define_opaque_type;
 use rustc::middle::lang_items;
 use rustc::traits::{self, ObligationCause, ObligationCauseCode};
 use rustc::ty::subst::{InternalSubsts, Subst};
 use rustc::ty::{self, AdtKind, GenericParamDefKind, ToPredicate, Ty, TyCtxt, TypeFoldable};
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
+use rustc_errors::{struct_span_err, DiagnosticBuilder};
 use rustc_hir::def_id::DefId;
 use rustc_hir::ItemKind;
 use rustc_span::symbol::sym;
index ab8e4ce6975a976b966b2ea55e68486be9524e5a..ec098c1d89679c9ec1456c359fd6c45f60e140cf 100644 (file)
@@ -1,15 +1,13 @@
 use crate::lint;
 use rustc::ty::TyCtxt;
-
-use errors::Applicability;
-use rustc_span::Span;
-use syntax::ast;
-
 use rustc_data_structures::fx::FxHashMap;
+use rustc_errors::Applicability;
 use rustc_hir as hir;
 use rustc_hir::def_id::{DefId, DefIdSet, LOCAL_CRATE};
 use rustc_hir::itemlikevisit::ItemLikeVisitor;
 use rustc_hir::print::visibility_qualified;
+use rustc_span::Span;
+use syntax::ast;
 
 pub fn check_crate(tcx: TyCtxt<'_>) {
     let mut used_trait_imports = DefIdSet::default();
index 5af5acda143795056f3c8b70b9695b634009d017..8b3db15c02b4ecd18337b651dacb9bacb4ae26b9 100644 (file)
@@ -1,7 +1,6 @@
 //! Check properties that are required by built-in traits and set
 //! up data structures required by type-checking/codegen.
 
-use errors::struct_span_err;
 use rustc::infer;
 use rustc::infer::outlives::env::OutlivesEnvironment;
 use rustc::infer::SuppressRegionErrors;
@@ -14,6 +13,7 @@
 use rustc::ty::TypeFoldable;
 use rustc::ty::{self, Ty, TyCtxt};
 use rustc_error_codes::*;
+use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::def_id::DefId;
 use rustc_hir::ItemKind;
index 73d03f9244721b15877d3f1da36966f3fb9ab2f3..673c1bd9fd83103ec99bfa9d65adc420b2eb29ee 100644 (file)
@@ -7,8 +7,8 @@
 //! `tcx.inherent_impls(def_id)`). That value, however,
 //! is computed by selecting an idea from this table.
 
-use errors::struct_span_err;
 use rustc::ty::{self, CrateInherentImpls, TyCtxt};
+use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
 use rustc_hir::itemlikevisit::ItemLikeVisitor;
index 01d2f528d4563b2598debdeabd260bc6277ef412..a9228c7f6bb4c86dc655dbbce9e8c2020f44de3e 100644 (file)
@@ -1,7 +1,7 @@
 use crate::namespace::Namespace;
-use errors::struct_span_err;
 use rustc::traits::{self, IntercrateMode};
 use rustc::ty::TyCtxt;
+use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
 use rustc_hir::itemlikevisit::ItemLikeVisitor;
index ca10601f4135b414f3caf13981b93af33924f0e4..fd685e77b418ccc09543a761f73638c3f7f48b1a 100644 (file)
@@ -5,14 +5,13 @@
 // done by the orphan and overlap modules. Then we build up various
 // mappings. That mapping code resides here.
 
-use crate::hir::def_id::{DefId, LOCAL_CRATE};
-use crate::hir::HirId;
-use errors::struct_span_err;
 use rustc::traits;
 use rustc::ty::query::Providers;
 use rustc::ty::{self, TyCtxt, TypeFoldable};
-
 use rustc_error_codes::*;
+use rustc_errors::struct_span_err;
+use rustc_hir::def_id::{DefId, LOCAL_CRATE};
+use rustc_hir::HirId;
 
 mod builtin;
 mod inherent_impls;
index cf9935143b2d7e484b93156a394bc6f6af6a9c79..1878f9385a891696e2a63d66075f4162585a6b9a 100644 (file)
@@ -1,9 +1,9 @@
 //! Orphan checker: every impl either implements a trait defined in this
 //! crate or pertains to a type defined in this crate.
 
-use errors::struct_span_err;
 use rustc::traits;
 use rustc::ty::{self, TyCtxt};
+use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::itemlikevisit::ItemLikeVisitor;
 
index 9257aa759b4cf50bf5d7fb74149bc88bfe92aa5e..3f4035b0998d64c4d756cb0b485db4c674859202 100644 (file)
@@ -1,8 +1,8 @@
 //! Unsafety checker: every impl either implements a trait defined in this
 //! crate or pertains to a type defined in this crate.
 
-use errors::struct_span_err;
 use rustc::ty::TyCtxt;
+use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::itemlikevisit::ItemLikeVisitor;
 use rustc_hir::Unsafety;
index 3bb06d76349834043d2ffebd861203a0f1ffc858..64e71cc42e0ca05bbe360e9c88ffdeca08bdddd4 100644 (file)
@@ -20,7 +20,6 @@
 use crate::lint;
 use crate::middle::resolve_lifetime as rl;
 use crate::middle::weak_lang_items;
-use errors::{struct_span_err, Applicability, StashKey};
 use rustc::hir::map::Map;
 use rustc::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs};
 use rustc::mir::mono::Linkage;
@@ -34,6 +33,7 @@
 use rustc::ty::{ReprOptions, ToPredicate};
 use rustc_data_structures::captures::Captures;
 use rustc_data_structures::fx::FxHashMap;
+use rustc_errors::{struct_span_err, Applicability, StashKey};
 use rustc_hir as hir;
 use rustc_hir::def::{CtorKind, DefKind, Res};
 use rustc_hir::def_id::{DefId, LOCAL_CRATE};
@@ -255,7 +255,7 @@ fn visit_impl_item(&mut self, impl_item: &'tcx hir::ImplItem<'tcx>) {
 fn bad_placeholder_type(
     tcx: TyCtxt<'tcx>,
     mut spans: Vec<Span>,
-) -> errors::DiagnosticBuilder<'tcx> {
+) -> rustc_errors::DiagnosticBuilder<'tcx> {
     spans.sort();
     let mut err = struct_span_err!(
         tcx.sess,
index e3e61ebb93607fc694260713bebea420f34ff791..fb87b285fa29f56e139ea257cfdcb815ed643c0a 100644 (file)
@@ -9,10 +9,10 @@
 //! fixed, but for the moment it's easier to do these checks early.
 
 use crate::constrained_generic_params as cgp;
-use errors::struct_span_err;
 use rustc::ty::query::Providers;
 use rustc::ty::{self, TyCtxt, TypeFoldable};
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
+use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::def_id::DefId;
 use rustc_hir::itemlikevisit::ItemLikeVisitor;
index 0d9940cbf92c7ec368bb8776c66f046caadffcae..b951883ac195a2888c8b9803765d3e823e61e264 100644 (file)
@@ -91,7 +91,6 @@
 mod structured_errors;
 mod variance;
 
-use errors::struct_span_err;
 use rustc::infer::InferOk;
 use rustc::lint;
 use rustc::middle;
 use rustc::ty::{self, Ty, TyCtxt};
 use rustc::util;
 use rustc::util::common::ErrorReported;
+use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::def_id::{DefId, LOCAL_CRATE};
 use rustc_hir::Node;
index b693743e47496e1097f5715776ab498d0088cccd..908429c8dc48a8b215cde8db0ffd4635c412bac7 100644 (file)
@@ -1,5 +1,5 @@
-use errors::struct_span_err;
 use rustc::ty::TyCtxt;
+use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::itemlikevisit::ItemLikeVisitor;
 use rustc_span::symbol::sym;
index dc6c45b41842c8e9e2655829e8f4870cda10bcbc..068814723f52d758e6a578062a5e6887f90c5db1 100644 (file)
@@ -1,6 +1,6 @@
-use errors::{Applicability, DiagnosticBuilder, DiagnosticId};
 use rustc::session::Session;
 use rustc::ty::{Ty, TypeFoldable};
+use rustc_errors::{Applicability, DiagnosticBuilder, DiagnosticId};
 use rustc_span::Span;
 
 use rustc_error_codes::*;
@@ -50,7 +50,7 @@ fn session(&self) -> &Session {
     }
 
     fn code(&self) -> DiagnosticId {
-        errors::error_code!(E0617)
+        rustc_errors::error_code!(E0617)
     }
 
     fn common(&self) -> DiagnosticBuilder<'tcx> {
@@ -111,7 +111,7 @@ fn session(&self) -> &Session {
     }
 
     fn code(&self) -> DiagnosticId {
-        errors::error_code!(E0607)
+        rustc_errors::error_code!(E0607)
     }
 
     fn common(&self) -> DiagnosticBuilder<'tcx> {
index 860bfe79395ffbebfc26f87d50feb26aab88b56c..2f41bee1819cd32dce67b698112d11c556e76aa8 100644 (file)
@@ -1,5 +1,5 @@
-use errors::struct_span_err;
 use rustc::ty::TyCtxt;
+use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::itemlikevisit::ItemLikeVisitor;
 use rustc_span::symbol::sym;
index c8f1dff703fb40b22f93ab552ab958f478792e98..5d8e27ecadb828dbe8edbd7db05671ddf777c39c 100644 (file)
@@ -497,7 +497,7 @@ pub fn has_doc_flag(&self, flag: Symbol) -> bool {
         false
     }
 
-    pub fn from_ast(diagnostic: &::errors::Handler, attrs: &[ast::Attribute]) -> Attributes {
+    pub fn from_ast(diagnostic: &::rustc_errors::Handler, attrs: &[ast::Attribute]) -> Attributes {
         let mut doc_strings = vec![];
         let mut sp = None;
         let mut cfg = Cfg::True;
index 26b49d2f9624e0fbe3b631727d24c45b8551e749..22f5d0dc2c07869c594a1e168abf46594c6dc169 100644 (file)
@@ -3,7 +3,6 @@
 use std::fmt;
 use std::path::PathBuf;
 
-use errors;
 use getopts;
 use rustc::lint::Level;
 use rustc::session;
@@ -566,7 +565,7 @@ pub fn markdown_input(&self) -> bool {
 }
 
 /// Prints deprecation warnings for deprecated options
-fn check_deprecated_options(matches: &getopts::Matches, diag: &errors::Handler) {
+fn check_deprecated_options(matches: &getopts::Matches, diag: &rustc_errors::Handler) {
     let deprecated_flags = ["input-format", "output-format", "no-defaults", "passes"];
 
     for flag in deprecated_flags.iter() {
index be7f7ea364f4705b0945cc18c2ac6c3b4335c541..3cda1b3be75f1a3f6fffabf69f3c533cfd0c16b2 100644 (file)
@@ -15,8 +15,8 @@
 use rustc_lint;
 use rustc_resolve as resolve;
 
-use errors::emitter::{Emitter, EmitterWriter};
-use errors::json::JsonEmitter;
+use rustc_errors::emitter::{Emitter, EmitterWriter};
+use rustc_errors::json::JsonEmitter;
 use rustc_span::source_map;
 use rustc_span::symbol::sym;
 use rustc_span::DUMMY_SP;
@@ -171,7 +171,7 @@ pub fn new_handler(
     error_format: ErrorOutputType,
     source_map: Option<Lrc<source_map::SourceMap>>,
     debugging_opts: &DebuggingOptions,
-) -> errors::Handler {
+) -> rustc_errors::Handler {
     let emitter: Box<dyn Emitter + sync::Send> = match error_format {
         ErrorOutputType::HumanReadable(kind) => {
             let (short, color_config) = kind.unzip();
@@ -198,7 +198,10 @@ pub fn new_handler(
         }
     };
 
-    errors::Handler::with_emitter_and_flags(emitter, debugging_opts.diagnostic_handler_flags(true))
+    rustc_errors::Handler::with_emitter_and_flags(
+        emitter,
+        debugging_opts.diagnostic_handler_flags(true),
+    )
 }
 
 pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOptions) {
@@ -409,7 +412,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
 
                 let mut krate = clean::krate(&mut ctxt);
 
-                fn report_deprecated_attr(name: &str, diag: &errors::Handler) {
+                fn report_deprecated_attr(name: &str, diag: &rustc_errors::Handler) {
                     let mut msg = diag.struct_warn(&format!(
                         "the `#![doc({})]` attribute is \
                                                          considered deprecated",
index 2a107e828f75ffafb9cc63bfc4b316a5c2e5eb38..ecc394a2bc992082dc558992658a7fa080023bf1 100644 (file)
@@ -9,8 +9,6 @@
 //! needs to read-after-write from a file, then it would be added to this
 //! abstraction.
 
-use errors;
-
 use std::fs;
 use std::io;
 use std::path::Path;
@@ -42,7 +40,7 @@ pub fn new() -> ErrorStorage {
     }
 
     /// Prints all stored errors. Returns the number of printed errors.
-    pub fn write_errors(&mut self, diag: &errors::Handler) -> usize {
+    pub fn write_errors(&mut self, diag: &rustc_errors::Handler) -> usize {
         let mut printed = 0;
         // In order to drop the sender part of the channel.
         self.sender = None;
index e0ed02c11c71a5aba491f6161ac0496e975b4f01..8b5a3a2ba61313cd209faf6862537882358d1bc2 100644 (file)
@@ -1,6 +1,5 @@
 use crate::html::markdown::{ErrorCodes, IdMap, Markdown, Playground};
 use crate::rustc_span::edition::Edition;
-use errors;
 use rustc_feature::UnstableFeatures;
 use std::fs;
 use std::path::Path;
@@ -26,7 +25,7 @@ pub fn load(
         after_content: &[String],
         md_before_content: &[String],
         md_after_content: &[String],
-        diag: &errors::Handler,
+        diag: &rustc_errors::Handler,
         id_map: &mut IdMap,
         edition: Edition,
         playground: &Option<Playground>,
@@ -58,7 +57,7 @@ pub enum LoadStringError {
 
 pub fn load_string<P: AsRef<Path>>(
     file_path: P,
-    diag: &errors::Handler,
+    diag: &rustc_errors::Handler,
 ) -> Result<String, LoadStringError> {
     let file_path = file_path.as_ref();
     let contents = match fs::read(file_path) {
@@ -77,7 +76,7 @@ pub fn load_string<P: AsRef<Path>>(
     }
 }
 
-fn load_external_files(names: &[String], diag: &errors::Handler) -> Option<String> {
+fn load_external_files(names: &[String], diag: &rustc_errors::Handler) -> Option<String> {
     let mut out = String::new();
     for name in names {
         let s = match load_string(name, diag) {
index a01e2f793948e668967b94697d720d9473193c95..2d932eb7668c41041ee767be827f74d3c91834a0 100644 (file)
@@ -42,7 +42,6 @@
 use std::str;
 use std::sync::Arc;
 
-use errors;
 use rustc::middle::privacy::AccessLevels;
 use rustc::middle::stability;
 use rustc_data_structures::flock;
@@ -394,7 +393,7 @@ pub fn run(
     mut krate: clean::Crate,
     options: RenderOptions,
     renderinfo: RenderInfo,
-    diag: &errors::Handler,
+    diag: &rustc_errors::Handler,
     edition: Edition,
 ) -> Result<(), Error> {
     // need to save a copy of the options for rendering the index page
@@ -528,7 +527,7 @@ fn write_shared(
     krate: &clean::Crate,
     search_index: String,
     options: &RenderOptions,
-    diag: &errors::Handler,
+    diag: &rustc_errors::Handler,
 ) -> Result<(), Error> {
     // Write out the shared files. Note that these are shared among all rustdoc
     // docs placed in the output directory, so this needs to be a synchronized
index 91150899877febd611a45910bde27002068afc9e..b15dae452ff051da09fc75608502aed03c6285aa 100644 (file)
@@ -24,6 +24,7 @@
 extern crate rustc_data_structures;
 extern crate rustc_driver;
 extern crate rustc_error_codes;
+extern crate rustc_errors;
 extern crate rustc_expand;
 extern crate rustc_feature;
 extern crate rustc_hir;
@@ -42,7 +43,6 @@
 extern crate test as testing;
 #[macro_use]
 extern crate log;
-extern crate rustc_errors as errors;
 
 use std::default::Default;
 use std::env;
@@ -518,6 +518,6 @@ fn rust_input<R, F>(options: config::Options, f: F) -> R
 
     match result {
         Ok(output) => output,
-        Err(_) => panic::resume_unwind(Box::new(errors::FatalErrorMarker)),
+        Err(_) => panic::resume_unwind(Box::new(rustc_errors::FatalErrorMarker)),
     }
 }
index 69aa248aa8e987f6cfc7486afc7334391d6b21a2..912a40722b8aff133c752ae4737a9a40b516c618 100644 (file)
@@ -2,7 +2,6 @@
 use std::io::prelude::*;
 use std::path::PathBuf;
 
-use errors;
 use rustc_feature::UnstableFeatures;
 use rustc_span::edition::Edition;
 use rustc_span::source_map::DUMMY_SP;
@@ -39,7 +38,7 @@ fn extract_leading_metadata(s: &str) -> (Vec<&str>, &str) {
 pub fn render(
     input: PathBuf,
     options: RenderOptions,
-    diag: &errors::Handler,
+    diag: &rustc_errors::Handler,
     edition: Edition,
 ) -> i32 {
     let mut output = options.output;
@@ -128,7 +127,7 @@ pub fn render(
 }
 
 /// Runs any tests/code examples in the markdown file `input`.
-pub fn test(mut options: Options, diag: &errors::Handler) -> i32 {
+pub fn test(mut options: Options, diag: &rustc_errors::Handler) -> i32 {
     let input_str = match load_string(&options.input, diag) {
         Ok(s) => s,
         Err(LoadStringError::ReadFail) => return 1,
index 79548eb6d647af0d141b328229d42d1188873c2a..0bab4423b3dfdb38449d97465df38b52620a4b07 100644 (file)
@@ -1,5 +1,5 @@
-use errors::{emitter::Emitter, Applicability, Diagnostic, Handler};
 use rustc_data_structures::sync::{Lock, Lrc};
+use rustc_errors::{emitter::Emitter, Applicability, Diagnostic, Handler};
 use rustc_parse::lexer::StringReader as Lexer;
 use rustc_span::source_map::{FilePathMapping, SourceMap};
 use rustc_span::{FileName, InnerSpan};
index b1cd3deecb479996d3eeb6f07943b391d5eadabd..50d5f70f4889a37eb45960d977d1d543ee924787 100644 (file)
@@ -1,6 +1,6 @@
-use errors::Applicability;
 use rustc::lint;
 use rustc::ty;
+use rustc_errors::Applicability;
 use rustc_expand::base::SyntaxExtensionKind;
 use rustc_feature::UnstableFeatures;
 use rustc_hir as hir;
index 94e31108901eae8f12ef2a53f2103aad2997c8f6..cc5359b53d17c9eca0f785b32f5d7f00ec71797f 100644 (file)
@@ -389,8 +389,8 @@ pub fn make_test(
     // crate already is included.
     let result = rustc_driver::catch_fatal_errors(|| {
         with_globals(edition, || {
-            use errors::emitter::EmitterWriter;
-            use errors::Handler;
+            use rustc_errors::emitter::EmitterWriter;
+            use rustc_errors::Handler;
             use rustc_parse::maybe_new_parser_from_source_str;
             use rustc_span::source_map::FilePathMapping;
             use syntax::sess::ParseSess;
index b45531d7252a163eab1a9c3e439b9e944c9148e2..af1c50acb0a357bc7939761626ecf057f7bb8643 100644 (file)
@@ -3,7 +3,7 @@
 use std::hash::{Hash, Hasher};
 use std::path::Path;
 
-use errors::Handler;
+use rustc_errors::Handler;
 
 #[cfg(test)]
 mod tests;
index e4f0398fb42d26077cf49e2576199224095a47b7..7d9f715e9feb8c809ead5da130cfa946e95081b4 100644 (file)
@@ -13,8 +13,8 @@ doctest = false
 rustc_serialize = { path = "../libserialize", package = "serialize" }
 log = "0.4"
 scoped-tls = "1.0"
+rustc_errors = { path = "../librustc_errors" }
 rustc_span = { path = "../librustc_span" }
-errors = { path = "../librustc_errors", package = "rustc_errors" }
 rustc_data_structures = { path = "../librustc_data_structures" }
 rustc_feature = { path = "../librustc_feature" }
 rustc_index = { path = "../librustc_index" }
index b308d479545be195046297a306efd4b60cbda785..958e4373cc0ed999dc9ab3a66a68dfa5667d7c4a 100644 (file)
@@ -6,7 +6,7 @@
 use crate::print::pprust;
 use crate::sess::ParseSess;
 
-use errors::{struct_span_err, Applicability, Handler};
+use rustc_errors::{struct_span_err, Applicability, Handler};
 use rustc_feature::{find_gated_cfg, is_builtin_attr_name, Features, GatedCfg};
 use rustc_macros::HashStable_Generic;
 use rustc_span::hygiene::Transparency;
index 8449b61f7b0bbb61afb1e1bf34f8cd68cea85e66..ec05dab451af85c9da71f64c2ee87e1721fe9c71 100644 (file)
@@ -384,7 +384,7 @@ pub fn find_by_name(attrs: &[Attribute], name: Symbol) -> Option<&Attribute> {
 
 pub fn allow_internal_unstable<'a>(
     attrs: &[Attribute],
-    span_diagnostic: &'a errors::Handler,
+    span_diagnostic: &'a rustc_errors::Handler,
 ) -> Option<impl Iterator<Item = Symbol> + 'a> {
     find_by_name(attrs, sym::allow_internal_unstable).and_then(|attr| {
         attr.meta_item_list()
index 5e4319051728f72e6744924f98dc412f0743c42e..4eee4e943c2cd1a627012ec689ed7e276d14cf94 100644 (file)
@@ -4,9 +4,9 @@
 use crate::sess::ParseSess;
 use crate::visit::{self, FnKind, Visitor};
 
-use errors::{error_code, struct_span_err, Applicability, DiagnosticBuilder, Handler};
 use rustc_data_structures::fx::FxHashMap;
 use rustc_error_codes::*;
+use rustc_errors::{error_code, struct_span_err, Applicability, DiagnosticBuilder, Handler};
 use rustc_feature::{find_feature_issue, GateIssue};
 use rustc_feature::{AttributeGate, BUILTIN_ATTRIBUTE_MAP};
 use rustc_feature::{Feature, Features, State as FeatureState, UnstableFeatures};
index b197eab739427abd8766d18013af027ce9d27bd8..7ee4ca4603c9c1aba29e036c5c6a5518a85e54b6 100644 (file)
@@ -18,7 +18,6 @@
 #![recursion_limit = "256"]
 
 use ast::AttrId;
-pub use errors;
 use rustc_data_structures::sync::Lock;
 use rustc_index::bit_set::GrowableBitSet;
 use rustc_span::edition::{Edition, DEFAULT_EDITION};
index fb641239dfa4f5125befd5fb89e17bf79b9935ae..b70e2ce0d3eb7de4aef9c090e763eea3f85830d3 100644 (file)
@@ -29,7 +29,7 @@ fn from_str(s: &str) -> Result<Mode, ()> {
 }
 
 struct ShowSpanVisitor<'a> {
-    span_diagnostic: &'a errors::Handler,
+    span_diagnostic: &'a rustc_errors::Handler,
     mode: Mode,
 }
 
@@ -60,7 +60,7 @@ fn visit_mac(&mut self, mac: &'a ast::Mac) {
     }
 }
 
-pub fn run(span_diagnostic: &errors::Handler, mode: &str, krate: &ast::Crate) {
+pub fn run(span_diagnostic: &rustc_errors::Handler, mode: &str, krate: &ast::Crate) {
     let mode = match mode.parse().ok() {
         Some(mode) => mode,
         None => return,