Auto merge of #68380 - Dylan-DPC:rollup-a7moqmr, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #68326 (rustdoc: Catch fatal errors when syntax highlighting)
 - #68335 (Remove real_drop_in_place)
 - #68353 (Remove `rustc_error_codes` deps except in `rustc_driver`)
 - #68357 (rustdoc: Fix handling of compile errors when running `rustdoc --test`)
 - #68365 (Clean up error codes)

Failed merges:

r? @ghost
This commit is contained in:
bors 2020-01-20 05:56:53 +00:00
commit 900811e430
143 changed files with 171 additions and 274 deletions

View file

@ -3092,7 +3092,6 @@ dependencies = [
"rustc-rayon-core",
"rustc_apfloat",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_feature",
"rustc_hir",
@ -3358,7 +3357,6 @@ dependencies = [
"log",
"rustc",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_hir",
"rustc_index",
@ -3375,7 +3373,6 @@ version = "0.0.0"
dependencies = [
"log",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_feature",
"rustc_parse",
@ -3391,7 +3388,6 @@ dependencies = [
"fmt_macros",
"log",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_expand",
"rustc_feature",
@ -3445,7 +3441,6 @@ dependencies = [
"rustc_apfloat",
"rustc_codegen_utils",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_fs_util",
"rustc_hir",
@ -3675,7 +3670,6 @@ dependencies = [
"log",
"rustc",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_feature",
"rustc_hir",
@ -3716,7 +3710,6 @@ dependencies = [
"memmap",
"rustc",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_expand",
"rustc_hir",
@ -3744,7 +3737,6 @@ dependencies = [
"rustc",
"rustc_apfloat",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_hir",
"rustc_index",
@ -3767,7 +3759,6 @@ dependencies = [
"rustc",
"rustc_apfloat",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_hir",
"rustc_index",
@ -3786,7 +3777,6 @@ dependencies = [
"bitflags",
"log",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_feature",
"rustc_lexer",
@ -3804,7 +3794,6 @@ dependencies = [
"log",
"rustc",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_feature",
"rustc_hir",
@ -3820,7 +3809,6 @@ name = "rustc_plugin_impl"
version = "0.0.0"
dependencies = [
"rustc",
"rustc_error_codes",
"rustc_errors",
"rustc_hir",
"rustc_lint",
@ -3836,7 +3824,6 @@ dependencies = [
"log",
"rustc",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_hir",
"rustc_span",
@ -3854,7 +3841,6 @@ dependencies = [
"rustc",
"rustc_ast_lowering",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_expand",
"rustc_feature",
@ -3890,7 +3876,6 @@ dependencies = [
"log",
"num_cpus",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_feature",
"rustc_fs_util",
@ -3973,7 +3958,6 @@ dependencies = [
"log",
"rustc",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_hir",
"rustc_index",
@ -4493,7 +4477,6 @@ version = "0.0.0"
dependencies = [
"log",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_feature",
"rustc_index",

View file

@ -169,22 +169,12 @@ mod mut_ptr;
/// i.e., you do not usually have to worry about such issues unless you call `drop_in_place`
/// manually.
#[stable(feature = "drop_in_place", since = "1.8.0")]
#[inline(always)]
pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
real_drop_in_place(&mut *to_drop)
}
// The real `drop_in_place` -- the one that gets called implicitly when variables go
// out of scope -- should have a safe reference and not a raw pointer as argument
// type. When we drop a local variable, we access it with a pointer that behaves
// like a safe reference; transmuting that to a raw pointer does not mean we can
// actually access it with raw pointers.
#[lang = "drop_in_place"]
#[allow(unconditional_recursion)]
unsafe fn real_drop_in_place<T: ?Sized>(to_drop: &mut T) {
pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
// Code here does not matter - this is replaced by the
// real drop glue by the compiler.
real_drop_in_place(to_drop)
drop_in_place(to_drop)
}
/// Creates a null raw pointer.

View file

@ -37,5 +37,4 @@ byteorder = { version = "1.3" }
chalk-engine = { version = "0.9.0", default-features=false }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
measureme = "0.7.1"
rustc_error_codes = { path = "../librustc_error_codes" }
rustc_session = { path = "../librustc_session" }

View file

@ -8,7 +8,6 @@ use crate::hir::map::Map;
use crate::ty::query::Providers;
use crate::ty::TyCtxt;
use rustc_error_codes::*;
use rustc_errors::struct_span_err;
use rustc_hir as hir;
use rustc_hir::def_id::DefId;

View file

@ -65,7 +65,6 @@ use crate::ty::{
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;

View file

@ -13,8 +13,6 @@ use rustc_span::symbol::kw;
use rustc_span::Span;
use std::borrow::Cow;
use rustc_error_codes::*;
struct FindLocalByTypeVisitor<'a, 'tcx> {
infcx: &'a InferCtxt<'a, 'tcx>,
target_ty: Ty<'tcx>,

View file

@ -5,7 +5,6 @@ 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 rustc_error_codes::*;
use rustc_errors::struct_span_err;
impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {

View file

@ -5,8 +5,6 @@ use crate::ty;
use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder};
use rustc_hir::{FunctionRetTy, TyKind};
use rustc_error_codes::*;
impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
/// When given a `ConcreteFailure` for a function with parameters containing a named region and
/// an anonymous region, emit an descriptive diagnostic error.

View file

@ -5,8 +5,6 @@ use crate::ty::error::TypeError;
use crate::ty::{self, Region};
use rustc_errors::{struct_span_err, DiagnosticBuilder};
use rustc_error_codes::*;
impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
pub(super) fn note_region_origin(
&self,

View file

@ -15,8 +15,6 @@ use rustc_hir::def_id::{DefId, DefIdMap};
use rustc_hir::Node;
use rustc_span::Span;
use rustc_error_codes::*;
pub type OpaqueTypeMap<'tcx> = DefIdMap<OpaqueTypeDecl<'tcx>>;
/// Information about the opaque types whose values we

View file

@ -24,8 +24,6 @@ use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
use syntax::ast;
use rustc_error_codes::*;
// The actual lang items defined come at the end of this file in one handy table.
// So you probably just want to nip down to the end.
macro_rules! language_item_table {

View file

@ -15,8 +15,6 @@ use rustc_span::Span;
use rustc_target::spec::PanicStrategy;
use syntax::ast;
use rustc_error_codes::*;
macro_rules! weak_lang_items {
($($name:ident, $item:ident, $sym:ident;)*) => (

View file

@ -16,8 +16,6 @@ use rustc_span::{Pos, Span};
use rustc_target::spec::abi::Abi;
use std::{any::Any, env, fmt};
use rustc_error_codes::*;
#[derive(Debug, Copy, Clone, PartialEq, Eq, HashStable, RustcEncodable, RustcDecodable)]
pub enum ErrorHandled {
/// Already reported a lint or an error for this evaluation.

View file

@ -30,8 +30,6 @@ use rustc_span::{ExpnKind, Span, DUMMY_SP};
use std::fmt;
use syntax::ast;
use rustc_error_codes::*;
impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
pub fn report_fulfillment_errors(
&self,

View file

@ -20,8 +20,6 @@ use rustc_span::symbol::{kw, sym};
use rustc_span::{MultiSpan, Span, DUMMY_SP};
use std::fmt;
use rustc_error_codes::*;
impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
crate fn suggest_restricting_param_bound(
&self,

View file

@ -11,8 +11,6 @@ use rustc_span::Span;
use syntax::ast::{MetaItem, NestedMetaItem};
use syntax::attr;
use rustc_error_codes::*;
#[derive(Clone, Debug)]
pub struct OnUnimplementedFormatString(Symbol);

View file

@ -6,8 +6,6 @@ use crate::ty::{self, Ty, TyCtxt};
use rustc_span::source_map::Span;
use std::iter::FromIterator;
use rustc_error_codes::*;
impl<'cx, 'tcx> At<'cx, 'tcx> {
/// Given a type `ty` of some value being dropped, computes a set
/// of "kinds" (types, regions) that must be outlive the execution

View file

@ -25,8 +25,6 @@ use rustc_span::DUMMY_SP;
use super::util::impl_trait_ref_and_oblig;
use super::{FulfillmentContext, SelectionContext};
use rustc_error_codes::*;
/// Information pertinent to an overlapping impl error.
#[derive(Debug)]
pub struct OverlapError {

View file

@ -25,8 +25,6 @@ use std::hash::{Hash, Hasher};
use std::mem;
use std::ptr;
use rustc_error_codes::*;
pub struct QueryCache<'tcx, D: QueryConfig<'tcx> + ?Sized> {
pub(super) results: FxHashMap<D::Key, QueryValue<D::Value>>,
pub(super) active: FxHashMap<D::Key, QueryResult<'tcx>>,

View file

@ -17,7 +17,6 @@ rustc_target = { path = "../librustc_target" }
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_index = { path = "../librustc_index" }
rustc_span = { path = "../librustc_span" }
rustc_error_codes = { path = "../librustc_error_codes" }
rustc_errors = { path = "../librustc_errors" }
rustc_session = { path = "../librustc_session" }
syntax = { path = "../libsyntax" }

View file

@ -2,7 +2,6 @@ use super::{ImplTraitContext, LoweringContext, ParamMode, ParenthesizedGenericAr
use rustc::bug;
use rustc_data_structures::thin_vec::ThinVec;
use rustc_error_codes::*;
use rustc_errors::struct_span_err;
use rustc_hir as hir;
use rustc_hir::def::Res;

View file

@ -3,7 +3,6 @@ use super::{ImplTraitContext, ImplTraitPosition, ImplTraitTypeIdVisitor};
use rustc::arena::Arena;
use rustc::bug;
use rustc_error_codes::*;
use rustc_errors::struct_span_err;
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res};

View file

@ -41,7 +41,6 @@ use rustc::{bug, span_bug};
use rustc_data_structures::captures::Captures;
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::sync::Lrc;
use rustc_error_codes::*;
use rustc_errors::struct_span_err;
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Namespace, PartialRes, PerNS, Res};

View file

@ -3,7 +3,6 @@ use super::{GenericArgsCtor, ParenthesizedGenericArgs};
use rustc::lint::builtin::ELIDED_LIFETIMES_IN_PATHS;
use rustc::span_bug;
use rustc_error_codes::*;
use rustc_errors::{struct_span_err, Applicability};
use rustc_hir as hir;
use rustc_hir::def::{DefKind, PartialRes, Res};

View file

@ -12,7 +12,6 @@ path = "lib.rs"
log = "0.4"
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_errors = { path = "../librustc_errors" }
rustc_error_codes = { path = "../librustc_error_codes" }
rustc_feature = { path = "../librustc_feature" }
rustc_parse = { path = "../librustc_parse" }
rustc_session = { path = "../librustc_session" }

View file

@ -23,8 +23,6 @@ use syntax::print::pprust;
use syntax::visit::{self, Visitor};
use syntax::walk_list;
use rustc_error_codes::*;
/// A syntactic context that disallows certain kinds of bounds (e.g., `?Trait` or `?const Trait`).
#[derive(Clone, Copy)]
enum BoundContext {

View file

@ -1,4 +1,3 @@
use rustc_error_codes::*;
use rustc_errors::{struct_span_err, Handler};
use rustc_feature::{AttributeGate, BUILTIN_ATTRIBUTE_MAP};
use rustc_feature::{Features, GateIssue, UnstableFeatures};

View file

@ -22,4 +22,3 @@ smallvec = { version = "1.0", features = ["union", "may_dangle"] }
syntax = { path = "../libsyntax" }
rustc_expand = { path = "../librustc_expand" }
rustc_span = { path = "../librustc_span" }
rustc_error_codes = { path = "../librustc_error_codes" }

View file

@ -12,8 +12,6 @@ use syntax::ptr::P;
use syntax::token::{self, Token};
use syntax::tokenstream::{self, TokenStream};
use rustc_error_codes::*;
enum State {
Asm,
Outputs,

View file

@ -9,8 +9,6 @@ use rustc_span::Span;
use syntax::ast::{Expr, MetaItem};
use syntax::ptr::P;
use rustc_error_codes::*;
pub fn expand_deriving_default(
cx: &mut ExtCtxt<'_>,
span: Span,

View file

@ -32,5 +32,4 @@ rustc_hir = { path = "../librustc_hir" }
rustc_incremental = { path = "../librustc_incremental" }
rustc_index = { path = "../librustc_index" }
rustc_target = { path = "../librustc_target" }
rustc_error_codes = { path = "../librustc_error_codes" }
rustc_session = { path = "../librustc_session" }

View file

@ -13,8 +13,6 @@ use rustc_hir::def_id::DefId;
use crate::traits::BuilderMethods;
use rustc_hir as hir;
use rustc_error_codes::*;
pub enum IntPredicate {
IntEQ,
IntNE,

View file

@ -7,8 +7,6 @@ use super::OperandValue;
use crate::traits::BuilderMethods;
use crate::traits::*;
use rustc_error_codes::*;
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
pub fn codegen_statement(&mut self, mut bx: Bx, statement: &mir::Statement<'tcx>) -> Bx {
debug!("codegen_statement(statement={:?})", statement);

View file

@ -1,7 +1,7 @@
It is an error to define two associated items (like methods, associated types,
associated functions, etc.) with the same identifier.
Two associated items (like methods, associated types, associated functions,
etc.) were defined with the same identifier.
For example:
Erroneous code example:
```compile_fail,E0201
struct Foo(u8);

View file

@ -1,21 +1,24 @@
An attempt to implement the `Copy` trait for a struct failed because one of the
fields does not implement `Copy`. To fix this, you must implement `Copy` for the
mentioned field. Note that this may not be possible, as in the example of
The `Copy` trait was implemented on a type which contains a field that doesn't
implement the `Copy` trait.
Erroneous code example:
```compile_fail,E0204
struct Foo {
foo : Vec<u32>,
foo: Vec<u32>,
}
impl Copy for Foo { }
impl Copy for Foo { } // error!
```
This fails because `Vec<T>` does not implement `Copy` for any `T`.
The `Copy` trait is implemented by default only on primitive types. If your
type only contains primitive types, you'll be able to implement `Copy` on it.
Otherwise, it won't be possible.
Here's another example that will fail:
```compile_fail,E0204
#[derive(Copy)]
#[derive(Copy)] // error!
struct Foo<'a> {
ty: &'a mut bool,
}

View file

@ -6,16 +6,8 @@ macro_rules! register_diagnostics {
pub static DIAGNOSTICS: &[(&str, &str)] = &[
$( (stringify!($ecode), $message), )*
];
$(
pub const $ecode: () = ();
)*
$(
pub const $code: () = ();
)*
)
}
mod error_codes;
pub use error_codes::*;
pub use error_codes::DIAGNOSTICS;

View file

@ -399,8 +399,5 @@ macro_rules! struct_span_err {
#[macro_export]
macro_rules! error_code {
($code:ident) => {{
let _ = $code;
$crate::DiagnosticId::Error(stringify!($code).to_owned())
}};
($code:ident) => {{ $crate::DiagnosticId::Error(stringify!($code).to_owned()) }};
}

View file

@ -13,7 +13,6 @@ log = "0.4"
unicode-security = "0.0.2"
rustc = { path = "../librustc" }
rustc_errors = { path = "../librustc_errors" }
rustc_error_codes = { path = "../librustc_error_codes" }
rustc_hir = { path = "../librustc_hir" }
rustc_target = { path = "../librustc_target" }
syntax = { path = "../libsyntax" }

View file

@ -26,7 +26,6 @@ use rustc::ty::layout::{LayoutError, LayoutOf, TyLayout};
use rustc::ty::{self, print::Printer, subst::GenericArg, Ty, TyCtxt};
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync;
use rustc_error_codes::*;
use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder};
use rustc_hir as hir;
use rustc_hir::def_id::{CrateNum, DefId};

View file

@ -6,7 +6,6 @@ use rustc::lint::{LintLevelMap, LintLevelSets, LintSet, LintSource};
use rustc::ty::query::Providers;
use rustc::ty::TyCtxt;
use rustc_data_structures::fx::FxHashMap;
use rustc_error_codes::*;
use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder};
use rustc_hir as hir;
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};

View file

@ -26,7 +26,6 @@ syntax = { path = "../libsyntax" }
rustc_expand = { path = "../librustc_expand" }
rustc_parse = { path = "../librustc_parse" }
rustc_span = { path = "../librustc_span" }
rustc_error_codes = { path = "../librustc_error_codes" }
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["errhandlingapi", "libloaderapi"] }

View file

@ -12,7 +12,6 @@ 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};

View file

@ -241,8 +241,6 @@ use rustc_data_structures::owning_ref::OwningRef;
use log::{debug, info, warn};
use rustc_error_codes::*;
#[derive(Clone)]
struct CrateMismatch {
path: PathBuf,

View file

@ -3,7 +3,6 @@ use rustc::session::parse::feature_err;
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;

View file

@ -29,4 +29,3 @@ syntax = { path = "../libsyntax" }
rustc_span = { path = "../librustc_span" }
rustc_apfloat = { path = "../librustc_apfloat" }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
rustc_error_codes = { path = "../librustc_error_codes" }

View file

@ -27,7 +27,6 @@ use rustc::ty::{
TyCtxt, UserType, UserTypeAnnotationIndex,
};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_error_codes::*;
use rustc_errors::struct_span_err;
use rustc_hir as hir;
use rustc_hir::def_id::DefId;

View file

@ -10,8 +10,6 @@ use rustc_span::{Span, Symbol};
use super::{ConstKind, Item};
use rustc_error_codes::*;
/// An operation that is not *always* allowed in a const context.
pub trait NonConstOp: std::fmt::Debug {
/// Whether this operation can be evaluated by miri.

View file

@ -6,7 +6,6 @@ use rustc::mir::*;
use rustc::traits::{self, TraitEngine};
use rustc::ty::cast::CastTy;
use rustc::ty::{self, TyCtxt};
use rustc_error_codes::*;
use rustc_errors::struct_span_err;
use rustc_hir::{def_id::DefId, HirId};
use rustc_index::bit_set::BitSet;

View file

@ -18,8 +18,6 @@ use std::ops::Bound;
use crate::const_eval::{is_const_fn, is_min_const_fn};
use crate::util;
use rustc_error_codes::*;
pub struct UnsafetyChecker<'a, 'tcx> {
body: &'a Body<'tcx>,
const_context: bool,

View file

@ -1,5 +1,4 @@
use rustc::ty::{self, Ty, TyCtxt};
use rustc_error_codes::*;
use rustc_errors::{struct_span_err, DiagnosticBuilder, DiagnosticId};
use rustc_span::{MultiSpan, Span};

View file

@ -25,4 +25,3 @@ rustc_span = { path = "../librustc_span" }
rustc_target = { path = "../librustc_target" }
syntax = { path = "../libsyntax" }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
rustc_error_codes = { path = "../librustc_error_codes" }

View file

@ -9,7 +9,6 @@ use rustc::lint;
use rustc::session::parse::feature_err;
use rustc::session::Session;
use rustc::ty::{self, Ty, TyCtxt};
use rustc_error_codes::*;
use rustc_errors::{error_code, struct_span_err, Applicability, DiagnosticBuilder};
use rustc_hir as hir;
use rustc_hir::def::*;

View file

@ -28,8 +28,6 @@ use syntax::ast;
use std::cmp::Ordering;
use std::fmt;
use rustc_error_codes::*;
#[derive(Clone, Debug)]
crate enum PatternError {
AssocConstInPattern(Span),

View file

@ -16,7 +16,6 @@ rustc_data_structures = { path = "../librustc_data_structures" }
rustc_feature = { path = "../librustc_feature" }
rustc_lexer = { path = "../librustc_lexer" }
rustc_errors = { path = "../librustc_errors" }
rustc_error_codes = { path = "../librustc_error_codes" }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
rustc_session = { path = "../librustc_session" }
rustc_span = { path = "../librustc_span" }

View file

@ -10,7 +10,6 @@
use crate::{parse_in, validate_attr};
use rustc_data_structures::fx::FxHashMap;
use rustc_error_codes::*;
use rustc_errors::{error_code, struct_span_err, Applicability, Handler};
use rustc_feature::{Feature, Features, State as FeatureState};
use rustc_feature::{

View file

@ -1,7 +1,6 @@
use super::{BlockMode, Parser, PathStyle, SemiColonMode, SeqSep, TokenExpectType, TokenType};
use rustc_data_structures::fx::FxHashSet;
use rustc_error_codes::*;
use rustc_errors::{pluralize, struct_span_err};
use rustc_errors::{Applicability, DiagnosticBuilder, Handler, PResult};
use rustc_span::source_map::Spanned;

View file

@ -3,7 +3,6 @@ use super::{FollowedByType, Parser, PathStyle};
use crate::maybe_whole;
use rustc_error_codes::*;
use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder, PResult, StashKey};
use rustc_span::source_map::{self, respan, Span, Spanned};
use rustc_span::symbol::{kw, sym, Symbol};

View file

@ -33,8 +33,6 @@ use std::borrow::Cow;
use std::path::PathBuf;
use std::{cmp, mem, slice};
use rustc_error_codes::*;
bitflags::bitflags! {
struct Restrictions: u8 {
const STMT_EXPR = 1 << 0;

View file

@ -659,7 +659,6 @@ impl<'a> Parser<'a> {
}
pub(super) fn error_inclusive_range_with_no_end(&self, span: Span) {
use rustc_error_codes::E0586;
struct_span_err!(self.sess.span_diagnostic, span, E0586, "inclusive range with no end")
.span_suggestion_short(
span,

View file

@ -3,7 +3,6 @@ use super::{Parser, PathStyle, PrevTokenKind, TokenType};
use crate::{maybe_recover_from_interpolated_ty_qpath, maybe_whole};
use rustc_error_codes::*;
use rustc_errors::{pluralize, struct_span_err, Applicability, PResult};
use rustc_span::source_map::Span;
use rustc_span::symbol::{kw, sym};

View file

@ -20,4 +20,3 @@ rustc_session = { path = "../librustc_session" }
rustc_target = { path = "../librustc_target" }
syntax = { path = "../libsyntax" }
rustc_span = { path = "../librustc_span" }
rustc_error_codes = { path = "../librustc_error_codes" }

View file

@ -12,7 +12,6 @@ use rustc::session::config::nightly_options;
use rustc::session::parse::feature_err;
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;

View file

@ -12,8 +12,6 @@ use rustc_span::{Span, DUMMY_SP};
use syntax::attr;
use syntax::entry::EntryPointType;
use rustc_error_codes::*;
struct EntryContext<'a, 'tcx> {
session: &'a Session,

View file

@ -11,8 +11,6 @@ use rustc_index::vec::Idx;
use rustc_span::{sym, Span};
use rustc_target::spec::abi::Abi::RustIntrinsic;
use rustc_error_codes::*;
fn check_mod_intrinsics(tcx: TyCtxt<'_>, module_def_id: DefId) {
tcx.hir().visit_item_likes_in_module(module_def_id, &mut ItemVisitor { tcx }.as_deep_visitor());
}

View file

@ -15,8 +15,6 @@ use rustc_span::symbol::Symbol;
use rustc_span::{sym, Span};
use syntax::ast::{Attribute, MetaItem, MetaItemKind};
use rustc_error_codes::*;
fn new_lib_features() -> LibFeatures {
LibFeatures { stable: Default::default(), unstable: Default::default() }
}

View file

@ -1,7 +1,5 @@
use Context::*;
use rustc::session::Session;
use rustc::hir::map::Map;
use rustc::ty::query::Providers;
use rustc::ty::TyCtxt;
@ -10,10 +8,9 @@ use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
use rustc_hir::{Destination, Movability, Node};
use rustc_session::Session;
use rustc_span::Span;
use rustc_error_codes::*;
#[derive(Clone, Copy, Debug, PartialEq)]
enum Context {
Normal,

View file

@ -26,8 +26,6 @@ use std::cmp::Ordering;
use std::mem::replace;
use std::num::NonZeroU32;
use rustc_error_codes::*;
#[derive(PartialEq)]
enum AnnotationKind {
// Annotation is required if not inherited from unstable parents

View file

@ -18,4 +18,3 @@ rustc_lint = { path = "../librustc_lint" }
rustc_metadata = { path = "../librustc_metadata" }
syntax = { path = "../libsyntax" }
rustc_span = { path = "../librustc_span" }
rustc_error_codes = { path = "../librustc_error_codes" }

View file

@ -3,7 +3,6 @@
use crate::Registry;
use rustc::middle::cstore::MetadataLoader;
use rustc::session::Session;
use rustc_error_codes::*;
use rustc_errors::struct_span_err;
use rustc_metadata::locator;
use rustc_span::symbol::sym;

View file

@ -16,5 +16,4 @@ rustc_typeck = { path = "../librustc_typeck" }
syntax = { path = "../libsyntax" }
rustc_span = { path = "../librustc_span" }
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_error_codes = { path = "../librustc_error_codes" }
log = "0.4"

View file

@ -27,8 +27,6 @@ use syntax::attr;
use std::marker::PhantomData;
use std::{cmp, fmt, mem};
use rustc_error_codes::*;
////////////////////////////////////////////////////////////////////////////////
/// Generic infrastructure used to implement specific visitors below.
////////////////////////////////////////////////////////////////////////////////

View file

@ -23,7 +23,6 @@ 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

@ -21,7 +21,6 @@ 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;

View file

@ -25,8 +25,6 @@ use crate::{BindingError, CrateLint, HasGenericParams, LegacyScope, Module, Modu
use crate::{NameBinding, NameBindingKind, PrivacyError, VisResolutionError};
use crate::{ParentScope, PathResult, ResolutionError, Resolver, Scope, ScopeSet, Segment};
use rustc_error_codes::*;
type Res = def::Res<ast::NodeId>;
/// A vector of spans and replacements, a message and applicability.

View file

@ -29,8 +29,6 @@ use syntax::ast::{Ident, Name, NodeId};
use syntax::unwrap_or;
use syntax::util::lev_distance::find_best_match_for_name;
use rustc_error_codes::*;
use log::*;
use std::cell::Cell;

View file

@ -31,8 +31,6 @@ use log::debug;
use std::collections::BTreeSet;
use std::mem::replace;
use rustc_error_codes::*;
mod diagnostics;
type Res = def::Res<NodeId>;

View file

@ -6,7 +6,6 @@ use crate::{PathResult, PathSource, Segment};
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};

View file

@ -61,8 +61,6 @@ use imports::{ImportDirective, ImportDirectiveSubclass, ImportResolver, NameReso
use late::{HasGenericParams, PathSource, Rib, RibKind::*};
use macros::{LegacyBinding, LegacyScope};
use rustc_error_codes::*;
type Res = def::Res<NodeId>;
mod build_reduced_graph;

View file

@ -30,8 +30,6 @@ use syntax::walk_list;
use log::debug;
use rustc_error_codes::*;
// This counts the no of times a lifetime is used
#[derive(Clone, Copy, Debug)]
pub enum LifetimeUseSet<'tcx> {

View file

@ -10,7 +10,6 @@ path = "lib.rs"
[dependencies]
log = "0.4"
rustc_error_codes = { path = "../librustc_error_codes" }
rustc_errors = { path = "../librustc_errors" }
rustc_feature = { path = "../librustc_feature" }
rustc_target = { path = "../librustc_target" }

View file

@ -6,7 +6,6 @@ use crate::node_id::NodeId;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::sync::{Lock, Lrc, Once};
use rustc_error_codes::E0658;
use rustc_errors::{emitter::SilentEmitter, ColorConfig, Handler};
use rustc_errors::{error_code, Applicability, DiagnosticBuilder};
use rustc_feature::{find_feature_issue, GateIssue, UnstableFeatures};

View file

@ -22,4 +22,3 @@ smallvec = { version = "1.0", features = ["union", "may_dangle"] }
syntax = { path = "../libsyntax" }
rustc_span = { path = "../librustc_span" }
rustc_index = { path = "../librustc_index" }
rustc_error_codes = { path = "../librustc_error_codes" }

View file

@ -39,7 +39,6 @@ use std::iter;
use std::slice;
use rustc::mir::interpret::LitToConstInput;
use rustc_error_codes::*;
#[derive(Debug)]
pub struct PathSeg(pub DefId, pub usize);

View file

@ -13,8 +13,6 @@ use rustc_hir as hir;
use rustc_span::Span;
use syntax::ast::Ident;
use rustc_error_codes::*;
use std::iter;
#[derive(Copy, Clone, Debug)]

View file

@ -8,7 +8,6 @@ use rustc::ty::adjustment::{Adjust, Adjustment, AllowTwoPhase, AutoBorrow, AutoB
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;

View file

@ -49,8 +49,6 @@ use rustc_hir as hir;
use rustc_span::Span;
use syntax::ast;
use rustc_error_codes::*;
/// Reifies a cast check to be checked once we have full type information for
/// a function context.
pub struct CastCheck<'tcx> {

View file

@ -65,7 +65,6 @@ use rustc::ty::fold::TypeFoldable;
use rustc::ty::relate::RelateResult;
use rustc::ty::subst::SubstsRef;
use rustc::ty::{self, Ty, TypeAndMut};
use rustc_error_codes::*;
use rustc_errors::{struct_span_err, DiagnosticBuilder};
use rustc_hir as hir;
use rustc_hir::def_id::DefId;

View file

@ -15,8 +15,6 @@ use rustc_span::Span;
use super::{potentially_plural_count, FnCtxt, Inherited};
use rustc_error_codes::*;
/// Checks that a method from an impl conforms to the signature of
/// the same method as declared in the trait.
///

View file

@ -14,8 +14,6 @@ use rustc_errors::struct_span_err;
use rustc_span::Span;
use rustc_error_codes::*;
/// This function confirms that the `Drop` implementation identified by
/// `drop_impl_did` is not any more specialized than the type it is
/// attached to (Issue #8142).

View file

@ -38,8 +38,6 @@ use rustc_span::symbol::{kw, sym, Symbol};
use syntax::ast;
use syntax::util::lev_distance::find_best_match_for_name;
use rustc_error_codes::*;
use std::fmt::Display;
impl<'a, 'tcx> FnCtxt<'a, 'tcx> {

View file

@ -6,7 +6,6 @@ use crate::require_same_types;
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;

View file

@ -38,8 +38,6 @@ use std::ops::Deref;
use syntax::ast;
use syntax::util::lev_distance::{find_best_match_for_name, lev_distance};
use rustc_error_codes::*;
use smallvec::{smallvec, SmallVec};
use self::CandidateKind::*;

View file

@ -21,8 +21,6 @@ use rustc_span::{source_map, FileName, Span};
use syntax::ast;
use syntax::util::lev_distance;
use rustc_error_codes::*;
use std::cmp::Ordering;
use super::probe::Mode;

View file

@ -133,8 +133,6 @@ use syntax::ast;
use syntax::attr;
use syntax::util::parser::ExprPrecedence;
use rustc_error_codes::*;
use std::cell::{Cell, Ref, RefCell, RefMut};
use std::cmp;
use std::collections::hash_map::Entry;

View file

@ -11,8 +11,6 @@ use rustc_hir as hir;
use rustc_span::Span;
use syntax::ast::Ident;
use rustc_error_codes::*;
impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
/// Checks a `a <op>= b`
pub fn check_binop_assign(

View file

@ -15,8 +15,6 @@ use rustc_span::Span;
use syntax::ast;
use syntax::util::lev_distance::find_best_match_for_name;
use rustc_error_codes::*;
use std::cmp;
use std::collections::hash_map::Entry::{Occupied, Vacant};

View file

@ -18,8 +18,6 @@ use syntax::ast;
use rustc_hir as hir;
use rustc_hir::itemlikevisit::ParItemLikeVisitor;
use rustc_error_codes::*;
/// Helper type of a temporary returned by `.for_item(...)`.
/// This is necessary because we can't write the following bound:
///

View file

@ -12,7 +12,6 @@ use rustc::traits::{self, ObligationCause, TraitEngine};
use rustc::ty::adjustment::CoerceUnsizedInfo;
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;

View file

@ -16,8 +16,6 @@ use rustc_hir::itemlikevisit::ItemLikeVisitor;
use rustc_span::Span;
use syntax::ast;
use rustc_error_codes::*;
/// On-demand query: yields a map containing all types mapped to their inherent impls.
pub fn crate_inherent_impls(tcx: TyCtxt<'_>, crate_num: CrateNum) -> &CrateInherentImpls {
assert_eq!(crate_num, LOCAL_CRATE);

View file

@ -6,8 +6,6 @@ use rustc_hir as hir;
use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
use rustc_hir::itemlikevisit::ItemLikeVisitor;
use rustc_error_codes::*;
pub fn crate_inherent_impls_overlap_check(tcx: TyCtxt<'_>, crate_num: CrateNum) {
assert_eq!(crate_num, LOCAL_CRATE);
let krate = tcx.hir().krate();

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