Skip to content

Commit

Permalink
Auto merge of #68380 - Dylan-DPC:rollup-a7moqmr, r=Dylan-DPC
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Jan 20, 2020
2 parents 29b854f + 0259c10 commit 900811e
Show file tree
Hide file tree
Showing 143 changed files with 171 additions and 274 deletions.
17 changes: 0 additions & 17 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3092,7 +3092,6 @@ dependencies = [
"rustc-rayon-core",
"rustc_apfloat",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_feature",
"rustc_hir",
Expand Down Expand Up @@ -3358,7 +3357,6 @@ dependencies = [
"log",
"rustc",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_hir",
"rustc_index",
Expand All @@ -3375,7 +3373,6 @@ version = "0.0.0"
dependencies = [
"log",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_feature",
"rustc_parse",
Expand All @@ -3391,7 +3388,6 @@ dependencies = [
"fmt_macros",
"log",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_expand",
"rustc_feature",
Expand Down Expand Up @@ -3445,7 +3441,6 @@ dependencies = [
"rustc_apfloat",
"rustc_codegen_utils",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_fs_util",
"rustc_hir",
Expand Down Expand Up @@ -3675,7 +3670,6 @@ dependencies = [
"log",
"rustc",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_feature",
"rustc_hir",
Expand Down Expand Up @@ -3716,7 +3710,6 @@ dependencies = [
"memmap",
"rustc",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_expand",
"rustc_hir",
Expand Down Expand Up @@ -3744,7 +3737,6 @@ dependencies = [
"rustc",
"rustc_apfloat",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_hir",
"rustc_index",
Expand All @@ -3767,7 +3759,6 @@ dependencies = [
"rustc",
"rustc_apfloat",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_hir",
"rustc_index",
Expand All @@ -3786,7 +3777,6 @@ dependencies = [
"bitflags",
"log",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_feature",
"rustc_lexer",
Expand All @@ -3804,7 +3794,6 @@ dependencies = [
"log",
"rustc",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_feature",
"rustc_hir",
Expand All @@ -3820,7 +3809,6 @@ name = "rustc_plugin_impl"
version = "0.0.0"
dependencies = [
"rustc",
"rustc_error_codes",
"rustc_errors",
"rustc_hir",
"rustc_lint",
Expand All @@ -3836,7 +3824,6 @@ dependencies = [
"log",
"rustc",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_hir",
"rustc_span",
Expand All @@ -3854,7 +3841,6 @@ dependencies = [
"rustc",
"rustc_ast_lowering",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_expand",
"rustc_feature",
Expand Down Expand Up @@ -3890,7 +3876,6 @@ dependencies = [
"log",
"num_cpus",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_feature",
"rustc_fs_util",
Expand Down Expand Up @@ -3973,7 +3958,6 @@ dependencies = [
"log",
"rustc",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_hir",
"rustc_index",
Expand Down Expand Up @@ -4493,7 +4477,6 @@ version = "0.0.0"
dependencies = [
"log",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_feature",
"rustc_index",
Expand Down
14 changes: 2 additions & 12 deletions src/libcore/ptr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion src/librustc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
1 change: 0 additions & 1 deletion src/librustc/hir/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/librustc/infer/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions src/librustc/infer/error_reporting/need_type_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions src/librustc/infer/error_reporting/note.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions src/librustc/infer/opaque_types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/librustc/middle/lang_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions src/librustc/middle/weak_lang_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;)*) => (

Expand Down
2 changes: 0 additions & 2 deletions src/librustc/mir/interpret/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions src/librustc/traits/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions src/librustc/traits/error_reporting/suggestions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions src/librustc/traits/on_unimplemented.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 0 additions & 2 deletions src/librustc/traits/query/dropck_outlives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/librustc/traits/specialize/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions src/librustc/ty/query/plumbing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>>,
Expand Down
1 change: 0 additions & 1 deletion src/librustc_ast_lowering/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
1 change: 0 additions & 1 deletion src/librustc_ast_lowering/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/librustc_ast_lowering/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
1 change: 0 additions & 1 deletion src/librustc_ast_lowering/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
1 change: 0 additions & 1 deletion src/librustc_ast_lowering/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
1 change: 0 additions & 1 deletion src/librustc_ast_passes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 0 additions & 2 deletions src/librustc_ast_passes/ast_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion src/librustc_ast_passes/feature_gate.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
1 change: 0 additions & 1 deletion src/librustc_builtin_macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
2 changes: 0 additions & 2 deletions src/librustc_builtin_macros/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions src/librustc_builtin_macros/deriving/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion src/librustc_codegen_ssa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Loading

0 comments on commit 900811e

Please sign in to comment.