nix syntax::errors & prefer rustc_errors over errors

This commit is contained in:
Mazdak Farrokhzad 2020-01-09 11:18:47 +01:00
parent 2d8d559bbe
commit 8bd3d240e3
138 changed files with 242 additions and 276 deletions

View File

@ -3653,6 +3653,7 @@ dependencies = [
"log",
"rustc",
"rustc_data_structures",
"rustc_errors",
"rustc_feature",
"rustc_hir",
"rustc_index",

View 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" }

View File

@ -1,10 +1,10 @@
use crate::ty::{self, TyCtxt};
use errors::Diagnostic;
use parking_lot::{Condvar, Mutex};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
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;

View File

@ -9,8 +9,8 @@ use crate::lint::builtin::UNUSED_ATTRIBUTES;
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};

View File

@ -64,15 +64,13 @@ use crate::ty::{
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};

View File

@ -3,7 +3,7 @@ use crate::infer::type_variable::TypeVariableOriginKind;
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),
}
}
}

View File

@ -5,8 +5,8 @@ use crate::infer::error_reporting::nice_region_error::util::AnonymousParamInfo;
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.

View File

@ -3,7 +3,7 @@ use crate::infer::lexical_region_resolve::RegionResolutionError::*;
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;

View 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::*;

View File

@ -7,7 +7,7 @@ use crate::ty::error::ExpectedFound;
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;

View File

@ -5,7 +5,7 @@ use crate::infer::error_reporting::nice_region_error::NiceRegionError;
use crate::infer::lexical_region_resolve::RegionResolutionError;
use crate::ty::{BoundRegion, FreeRegion, RegionKind};
use crate::util::common::ErrorReported;
use 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.

View File

@ -3,7 +3,7 @@ use crate::infer::{self, InferCtxt, SubregionOrigin};
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::*;

View File

@ -21,10 +21,10 @@ use crate::ty::subst::{GenericArg, InternalSubsts, SubstsRef};
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;

View File

@ -6,10 +6,10 @@ use crate::ty::fold::{BottomUpFolder, TypeFoldable, TypeFolder, TypeVisitor};
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;

View 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;

View File

@ -25,10 +25,10 @@ use crate::middle::privacy::AccessLevels;
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};

View 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};

View File

@ -5,9 +5,9 @@ use crate::lint::builtin;
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};

View File

@ -23,8 +23,8 @@ pub use self::LintSource::*;
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};

View File

@ -14,8 +14,8 @@ use crate::middle::cstore::ExternCrate;
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;

View File

@ -7,8 +7,8 @@ use crate::lint::builtin::BuiltinLintDiagnostics;
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::symbol::{sym, Symbol};
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;

View File

@ -5,8 +5,8 @@ use crate::session::config;
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};

View File

@ -7,8 +7,8 @@ use crate::ty::query::TyCtxtAt;
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;

View 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"

View File

@ -21,8 +21,8 @@ use crate::ty::SubtypePredicate;
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;

View File

@ -3,8 +3,8 @@ use fmt_macros::{Parser, Piece, Position};
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;

View 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,

View 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());
}

View File

@ -17,8 +17,8 @@ use crate::traits::select::IntercrateAmbiguityCause;
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;

View File

@ -1,4 +1,4 @@
use errors::DiagnosticBuilder;
use rustc_errors::DiagnosticBuilder;
use rustc_span::Span;
use smallvec::SmallVec;

View File

@ -51,7 +51,6 @@ use rustc_hir::{HirId, Node, TraitCandidate};
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 @@ use rustc_data_structures::stable_hasher::{
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))]

View 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;

View File

@ -7,10 +7,10 @@ use crate::session::{CrateDisambiguator, Session};
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};

View File

@ -9,13 +9,13 @@ use crate::ty::query::Query;
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};
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;

View File

@ -8,7 +8,7 @@ use std::time::{Duration, Instant};
#[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![];

View 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" }

View 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};

View File

@ -1,4 +1,4 @@
use errors::{Applicability, DiagnosticBuilder};
use rustc_errors::{Applicability, DiagnosticBuilder};
use rustc_expand::base::*;
use rustc_parse::parser::Parser;

View 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;

View File

@ -2,7 +2,7 @@ use crate::deriving::generic::ty::*;
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;

View File

@ -3,10 +3,8 @@ use Position::*;
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::ptr::P;
use syntax::token;
use syntax::tokenstream::TokenStream;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use std::borrow::Cow;
use std::collections::hash_map::Entry;

View 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;

View 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);

View 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 {

View 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" }

View File

@ -24,7 +24,6 @@ extern crate lazy_static;
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::util::common::ErrorReported;
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);
}

View 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" }

View 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};
@ -13,13 +19,6 @@ use syntax::token;
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;

View File

@ -5,6 +5,8 @@ use crate::mbe::macro_rules::annotate_err_with_kind;
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;
@ -26,10 +28,7 @@ use syntax::tokenstream::{TokenStream, TokenTree};
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;

View File

@ -13,7 +13,7 @@ extern crate proc_macro as pm;
#[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,

View File

@ -85,7 +85,7 @@ use syntax::sess::ParseSess;
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};

View File

@ -8,6 +8,9 @@ use crate::mbe::macro_parser::{Error, Failure, Success};
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;
@ -22,17 +25,11 @@ use syntax::sess::ParseSess;
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`";

View File

@ -2,19 +2,17 @@ use crate::base::ExtCtxt;
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.

View 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::token::{self, Token, TokenKind};
use syntax::util::comments::is_doc_comment;
use syntax::with_default_globals;
use errors::{emitter::EmitterWriter, Handler};
use std::io;
use std::path::PathBuf;

View 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};

View 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 {

View 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::token;
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 @@ impl ToInternal<TokenStream> for TokenTree<Group, Punct, Ident, Literal> {
}
}
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),
}
}

View File

@ -6,9 +6,9 @@ use syntax::sess::ParseSess;
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::*;

View 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" }

View File

@ -2,9 +2,9 @@ use crate::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass};
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,

View File

@ -31,6 +31,7 @@ use rustc::lint::FutureIncompatibleInfo;
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::symbol::{kw, sym, Symbol};
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::ptr::P;
use syntax::tokenstream::{TokenStream, TokenTree};

View File

@ -2,6 +2,7 @@ use lint::{EarlyContext, LateContext, LintArray, LintContext};
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_span::{symbol::Ident, BytePos, Span};
use rustc_target::spec::abi::Abi;
use syntax::ast;
use syntax::attr;
use syntax::errors::Applicability;
#[derive(PartialEq)]
pub enum MethodLateContext {

View 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,

View File

@ -9,6 +9,7 @@ use rustc::ty::layout::{self, IntegerExt, LayoutOf, SizeSkeleton, VariantIdx};
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::source_map;
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;

View File

@ -5,17 +5,16 @@ use rustc::lint::builtin::UNUSED_ATTRIBUTES;
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;

View 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" }

View File

@ -12,25 +12,23 @@ use rustc::session::{CrateDisambiguator, Session};
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 {

View File

@ -215,7 +215,6 @@
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;
@ -223,6 +222,7 @@ use rustc::session::{config, CrateDisambiguator, Session};
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};

View 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;

View File

@ -6,13 +6,12 @@ use rustc::infer::{
};
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;

View 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

View 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" }

View 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 @@ impl<'a> AstValidator<'a> {
}
}
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,

View 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};

View 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};

View 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;

View 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;

View File

@ -96,12 +96,12 @@
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 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
.sess
.struct_span_err(expr.span, "`break` to unknown label")
.emit();
errors::FatalError.raise()
rustc_errors::FatalError.raise()
}
}
}

View File

@ -2,10 +2,10 @@ use Context::*;
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};

View 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::traits::misc::can_type_implement_copy;
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};

View 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"] }

View File

@ -20,18 +20,14 @@ use rustc::bug;
use rustc::hir::exports::Export;
use rustc::middle::cstore::CrateStore;
use rustc::ty;
use rustc_data_structures::sync::Lrc;
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_data_structures::sync::Lrc;
use std::cell::Cell;
use std::ptr;
use errors::{struct_span_err, Applicability};
use rustc_expand::base::SyntaxExtension;
use rustc_expand::expand::AstFragment;
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::token::{self, Token};
use syntax::visit::{self, Visitor};
use log::debug;
use rustc_error_codes::*;
use std::cell::Cell;
use std::ptr;
type Res = def::Res<NodeId>;

View 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;

View 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};

View File

@ -11,7 +11,6 @@ use crate::{BindingKey, ModuleKind, ResolutionError, Resolver, Segment};
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::ty;
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;

View File

@ -11,10 +11,9 @@ use crate::{path_names_to_string, BindingError, CrateLint, LexicalScopeBinding};
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::util::lev_distance::find_best_match_for_name;
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 @@ impl<'a> PathSource<'a> {
}
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),

View File

@ -4,10 +4,10 @@ use crate::path_names_to_string;
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 rustc_span::Span;
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 @@ impl<'a> LateResolutionVisitor<'a, '_> {
// 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 @@ impl<'a> LateResolutionVisitor<'a, '_> {
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",

View File

@ -20,7 +20,6 @@ pub use rustc_hir::def::{Namespace, PerNS};
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::ty::{self, DefIdTree, ResolverOutputs};
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};

View 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::session::Session;
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};

View 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" }

View File

@ -9,7 +9,6 @@ use crate::middle::resolve_lifetime as rl;
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::subst::{self, InternalSubsts, Subst, SubstsRef};
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_span::{MultiSpan, Span, DUMMY_SP};
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;

View 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;

View File

@ -3,22 +3,20 @@ use super::method::MethodCallee;
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).

View File

@ -34,7 +34,6 @@ use crate::hir::def_id::DefId;
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::cast::{CastKind, CastTy};
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;

View 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::fold::TypeFoldable;
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;

View 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::subst::{InternalSubsts, Subst};
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;

View File

@ -2,9 +2,9 @@ use crate::check::FnCtxt;
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;

View File

@ -2,7 +2,6 @@ use crate::check::regionck::RegionCtxt;
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::error::TypeError;
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;

View File

@ -17,7 +17,6 @@ use crate::check::TupleArgumentsFlag::DontTupleArguments;
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::Ty;
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;

View 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;

Some files were not shown because too many files have changed in this diff Show More