"log",
"rustc",
"rustc_data_structures",
+ "rustc_errors",
"rustc_feature",
"rustc_hir",
"rustc_index",
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" }
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;
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};
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};
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};
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),
}
}
}
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.
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;
//! 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::*;
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;
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.
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::*;
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;
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;
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;
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};
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};
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};
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};
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;
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;
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;
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};
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;
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"
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;
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;
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,
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());
}
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;
-use errors::DiagnosticBuilder;
+use rustc_errors::DiagnosticBuilder;
use rustc_span::Span;
use smallvec::SmallVec;
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;
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;
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))]
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;
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};
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;
#[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![];
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" }
//
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};
-use errors::{Applicability, DiagnosticBuilder};
+use rustc_errors::{Applicability, DiagnosticBuilder};
use rustc_expand::base::*;
use rustc_parse::parser::Parser;
-/// 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;
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;
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};
use syntax::token;
use syntax::tokenstream::TokenStream;
-use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use std::borrow::Cow;
use std::collections::hash_map::Entry;
-/// 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;
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,
}
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);
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,
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 {
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" }
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;
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;
/// 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);
// 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);
}
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" }
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;
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;
#[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,
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};
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`";
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.
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;
use syntax::util::comments::is_doc_comment;
use syntax::with_default_globals;
-use errors::{emitter::EmitterWriter, Handler};
use std::io;
use std::path::PathBuf;
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};
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 {
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};
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;
}
}
-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),
}
}
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::*;
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" }
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,
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;
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;
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;
use rustc_target::spec::abi::Abi;
use syntax::ast;
use syntax::attr;
-use syntax::errors::Applicability;
#[derive(PartialEq)]
pub enum MethodLateContext {
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,
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;
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;
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;
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" }
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 {
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};
-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;
};
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;
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
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" }
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" }
// 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};
}
}
- fn err_handler(&self) -> &errors::Handler {
+ fn err_handler(&self) -> &rustc_errors::Handler {
&self.session.diagnostic()
}
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,
//! 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};
-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};
-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;
// 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;
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;
.sess
.struct_span_err(expr.span, "`break` to unknown label")
.emit();
- errors::FatalError.raise()
+ rustc_errors::FatalError.raise()
}
}
}
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};
//! 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;
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};
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"] }
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};
use syntax::visit::{self, Visitor};
use log::debug;
-
-use rustc_error_codes::*;
+use std::cell::Cell;
+use std::ptr;
type Res = def::Res<NodeId>;
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;
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};
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};
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;
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};
use syntax::visit::{self, FnKind, Visitor};
use syntax::{unwrap_or, walk_list};
+use log::debug;
use std::collections::BTreeSet;
use std::mem::replace;
}
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),
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};
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>;
// 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"),
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",
use Determinacy::*;
-use errors::{struct_span_err, Applicability, DiagnosticBuilder};
use rustc::hir::exports::ExportMap;
use rustc::hir::map::{DefKey, Definitions};
use rustc::lint;
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};
//! 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::*;
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};
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" }
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;
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;
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;
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;
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).
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;
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;
//! 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};
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;
-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};
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;
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;
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;
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;
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;
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;
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;
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;
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;
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};
};
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;
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};
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};
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};
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)*)
}
})
}
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;
lhs_expr.span,
msg,
format!("*{}", lstring),
- errors::Applicability::MachineApplicable,
+ rustc_errors::Applicability::MachineApplicable,
);
suggested_deref = true;
}
/// 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>,
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 {
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;
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;
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();
//! 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;
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;
//! `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;
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;
// 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;
//! 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;
//! 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;
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;
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};
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,
//! 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;
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;
-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;
-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::*;
}
fn code(&self) -> DiagnosticId {
- errors::error_code!(E0617)
+ rustc_errors::error_code!(E0617)
}
fn common(&self) -> DiagnosticBuilder<'tcx> {
}
fn code(&self) -> DiagnosticId {
- errors::error_code!(E0607)
+ rustc_errors::error_code!(E0607)
}
fn common(&self) -> DiagnosticBuilder<'tcx> {
-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;
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;
use std::fmt;
use std::path::PathBuf;
-use errors;
use getopts;
use rustc::lint::Level;
use rustc::session;
}
/// 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() {
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;
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();
}
};
- 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) {
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",
//! 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;
}
/// 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;
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;
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>,
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) {
}
}
-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) {
use std::str;
use std::sync::Arc;
-use errors;
use rustc::middle::privacy::AccessLevels;
use rustc::middle::stability;
use rustc_data_structures::flock;
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
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
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;
extern crate test as testing;
#[macro_use]
extern crate log;
-extern crate rustc_errors as errors;
use std::default::Default;
use std::env;
match result {
Ok(output) => output,
- Err(_) => panic::resume_unwind(Box::new(errors::FatalErrorMarker)),
+ Err(_) => panic::resume_unwind(Box::new(rustc_errors::FatalErrorMarker)),
}
}
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;
pub fn render(
input: PathBuf,
options: RenderOptions,
- diag: &errors::Handler,
+ diag: &rustc_errors::Handler,
edition: Edition,
) -> i32 {
let mut output = options.output;
}
/// 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,
-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};
-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;
// 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;
use std::hash::{Hash, Hasher};
use std::path::Path;
-use errors::Handler;
+use rustc_errors::Handler;
#[cfg(test)]
mod tests;
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" }
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;
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()
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};
#![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};
}
struct ShowSpanVisitor<'a> {
- span_diagnostic: &'a errors::Handler,
+ span_diagnostic: &'a rustc_errors::Handler,
mode: Mode,
}
}
}
-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,