Skip to content

Commit 900811e

Browse files
committed
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
2 parents 29b854f + 0259c10 commit 900811e

File tree

143 files changed

+171
-274
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+171
-274
lines changed

Cargo.lock

-17
Original file line numberDiff line numberDiff line change
@@ -3092,7 +3092,6 @@ dependencies = [
30923092
"rustc-rayon-core",
30933093
"rustc_apfloat",
30943094
"rustc_data_structures",
3095-
"rustc_error_codes",
30963095
"rustc_errors",
30973096
"rustc_feature",
30983097
"rustc_hir",
@@ -3358,7 +3357,6 @@ dependencies = [
33583357
"log",
33593358
"rustc",
33603359
"rustc_data_structures",
3361-
"rustc_error_codes",
33623360
"rustc_errors",
33633361
"rustc_hir",
33643362
"rustc_index",
@@ -3375,7 +3373,6 @@ version = "0.0.0"
33753373
dependencies = [
33763374
"log",
33773375
"rustc_data_structures",
3378-
"rustc_error_codes",
33793376
"rustc_errors",
33803377
"rustc_feature",
33813378
"rustc_parse",
@@ -3391,7 +3388,6 @@ dependencies = [
33913388
"fmt_macros",
33923389
"log",
33933390
"rustc_data_structures",
3394-
"rustc_error_codes",
33953391
"rustc_errors",
33963392
"rustc_expand",
33973393
"rustc_feature",
@@ -3445,7 +3441,6 @@ dependencies = [
34453441
"rustc_apfloat",
34463442
"rustc_codegen_utils",
34473443
"rustc_data_structures",
3448-
"rustc_error_codes",
34493444
"rustc_errors",
34503445
"rustc_fs_util",
34513446
"rustc_hir",
@@ -3675,7 +3670,6 @@ dependencies = [
36753670
"log",
36763671
"rustc",
36773672
"rustc_data_structures",
3678-
"rustc_error_codes",
36793673
"rustc_errors",
36803674
"rustc_feature",
36813675
"rustc_hir",
@@ -3716,7 +3710,6 @@ dependencies = [
37163710
"memmap",
37173711
"rustc",
37183712
"rustc_data_structures",
3719-
"rustc_error_codes",
37203713
"rustc_errors",
37213714
"rustc_expand",
37223715
"rustc_hir",
@@ -3744,7 +3737,6 @@ dependencies = [
37443737
"rustc",
37453738
"rustc_apfloat",
37463739
"rustc_data_structures",
3747-
"rustc_error_codes",
37483740
"rustc_errors",
37493741
"rustc_hir",
37503742
"rustc_index",
@@ -3767,7 +3759,6 @@ dependencies = [
37673759
"rustc",
37683760
"rustc_apfloat",
37693761
"rustc_data_structures",
3770-
"rustc_error_codes",
37713762
"rustc_errors",
37723763
"rustc_hir",
37733764
"rustc_index",
@@ -3786,7 +3777,6 @@ dependencies = [
37863777
"bitflags",
37873778
"log",
37883779
"rustc_data_structures",
3789-
"rustc_error_codes",
37903780
"rustc_errors",
37913781
"rustc_feature",
37923782
"rustc_lexer",
@@ -3804,7 +3794,6 @@ dependencies = [
38043794
"log",
38053795
"rustc",
38063796
"rustc_data_structures",
3807-
"rustc_error_codes",
38083797
"rustc_errors",
38093798
"rustc_feature",
38103799
"rustc_hir",
@@ -3820,7 +3809,6 @@ name = "rustc_plugin_impl"
38203809
version = "0.0.0"
38213810
dependencies = [
38223811
"rustc",
3823-
"rustc_error_codes",
38243812
"rustc_errors",
38253813
"rustc_hir",
38263814
"rustc_lint",
@@ -3836,7 +3824,6 @@ dependencies = [
38363824
"log",
38373825
"rustc",
38383826
"rustc_data_structures",
3839-
"rustc_error_codes",
38403827
"rustc_errors",
38413828
"rustc_hir",
38423829
"rustc_span",
@@ -3854,7 +3841,6 @@ dependencies = [
38543841
"rustc",
38553842
"rustc_ast_lowering",
38563843
"rustc_data_structures",
3857-
"rustc_error_codes",
38583844
"rustc_errors",
38593845
"rustc_expand",
38603846
"rustc_feature",
@@ -3890,7 +3876,6 @@ dependencies = [
38903876
"log",
38913877
"num_cpus",
38923878
"rustc_data_structures",
3893-
"rustc_error_codes",
38943879
"rustc_errors",
38953880
"rustc_feature",
38963881
"rustc_fs_util",
@@ -3973,7 +3958,6 @@ dependencies = [
39733958
"log",
39743959
"rustc",
39753960
"rustc_data_structures",
3976-
"rustc_error_codes",
39773961
"rustc_errors",
39783962
"rustc_hir",
39793963
"rustc_index",
@@ -4493,7 +4477,6 @@ version = "0.0.0"
44934477
dependencies = [
44944478
"log",
44954479
"rustc_data_structures",
4496-
"rustc_error_codes",
44974480
"rustc_errors",
44984481
"rustc_feature",
44994482
"rustc_index",

src/libcore/ptr/mod.rs

+2-12
Original file line numberDiff line numberDiff line change
@@ -169,22 +169,12 @@ mod mut_ptr;
169169
/// i.e., you do not usually have to worry about such issues unless you call `drop_in_place`
170170
/// manually.
171171
#[stable(feature = "drop_in_place", since = "1.8.0")]
172-
#[inline(always)]
173-
pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
174-
real_drop_in_place(&mut *to_drop)
175-
}
176-
177-
// The real `drop_in_place` -- the one that gets called implicitly when variables go
178-
// out of scope -- should have a safe reference and not a raw pointer as argument
179-
// type. When we drop a local variable, we access it with a pointer that behaves
180-
// like a safe reference; transmuting that to a raw pointer does not mean we can
181-
// actually access it with raw pointers.
182172
#[lang = "drop_in_place"]
183173
#[allow(unconditional_recursion)]
184-
unsafe fn real_drop_in_place<T: ?Sized>(to_drop: &mut T) {
174+
pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
185175
// Code here does not matter - this is replaced by the
186176
// real drop glue by the compiler.
187-
real_drop_in_place(to_drop)
177+
drop_in_place(to_drop)
188178
}
189179

190180
/// Creates a null raw pointer.

src/librustc/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,4 @@ byteorder = { version = "1.3" }
3737
chalk-engine = { version = "0.9.0", default-features=false }
3838
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
3939
measureme = "0.7.1"
40-
rustc_error_codes = { path = "../librustc_error_codes" }
4140
rustc_session = { path = "../librustc_session" }

src/librustc/hir/check_attr.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use crate::hir::map::Map;
88
use crate::ty::query::Providers;
99
use crate::ty::TyCtxt;
1010

11-
use rustc_error_codes::*;
1211
use rustc_errors::struct_span_err;
1312
use rustc_hir as hir;
1413
use rustc_hir::def_id::DefId;

src/librustc/infer/error_reporting/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ use crate::ty::{
6565
Region, Ty, TyCtxt, TypeFoldable,
6666
};
6767
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
68-
use rustc_error_codes::*;
6968
use rustc_errors::{pluralize, struct_span_err};
7069
use rustc_errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString};
7170
use rustc_hir as hir;

src/librustc/infer/error_reporting/need_type_info.rs

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ use rustc_span::symbol::kw;
1313
use rustc_span::Span;
1414
use std::borrow::Cow;
1515

16-
use rustc_error_codes::*;
17-
1816
struct FindLocalByTypeVisitor<'a, 'tcx> {
1917
infcx: &'a InferCtxt<'a, 'tcx>,
2018
target_ty: Ty<'tcx>,

src/librustc/infer/error_reporting/nice_region_error/different_lifetimes.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use crate::infer::error_reporting::nice_region_error::util::AnonymousParamInfo;
55
use crate::infer::error_reporting::nice_region_error::NiceRegionError;
66
use crate::util::common::ErrorReported;
77

8-
use rustc_error_codes::*;
98
use rustc_errors::struct_span_err;
109

1110
impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {

src/librustc/infer/error_reporting/nice_region_error/named_anon_conflict.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ use crate::ty;
55
use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder};
66
use rustc_hir::{FunctionRetTy, TyKind};
77

8-
use rustc_error_codes::*;
9-
108
impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
119
/// When given a `ConcreteFailure` for a function with parameters containing a named region and
1210
/// an anonymous region, emit an descriptive diagnostic error.

src/librustc/infer/error_reporting/note.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ use crate::ty::error::TypeError;
55
use crate::ty::{self, Region};
66
use rustc_errors::{struct_span_err, DiagnosticBuilder};
77

8-
use rustc_error_codes::*;
9-
108
impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
119
pub(super) fn note_region_origin(
1210
&self,

src/librustc/infer/opaque_types/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ use rustc_hir::def_id::{DefId, DefIdMap};
1515
use rustc_hir::Node;
1616
use rustc_span::Span;
1717

18-
use rustc_error_codes::*;
19-
2018
pub type OpaqueTypeMap<'tcx> = DefIdMap<OpaqueTypeDecl<'tcx>>;
2119

2220
/// Information about the opaque types whose values we

src/librustc/middle/lang_items.rs

-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ use rustc_span::symbol::{sym, Symbol};
2424
use rustc_span::Span;
2525
use syntax::ast;
2626

27-
use rustc_error_codes::*;
28-
2927
// The actual lang items defined come at the end of this file in one handy table.
3028
// So you probably just want to nip down to the end.
3129
macro_rules! language_item_table {

src/librustc/middle/weak_lang_items.rs

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ use rustc_span::Span;
1515
use rustc_target::spec::PanicStrategy;
1616
use syntax::ast;
1717

18-
use rustc_error_codes::*;
19-
2018
macro_rules! weak_lang_items {
2119
($($name:ident, $item:ident, $sym:ident;)*) => (
2220

src/librustc/mir/interpret/error.rs

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ use rustc_span::{Pos, Span};
1616
use rustc_target::spec::abi::Abi;
1717
use std::{any::Any, env, fmt};
1818

19-
use rustc_error_codes::*;
20-
2119
#[derive(Debug, Copy, Clone, PartialEq, Eq, HashStable, RustcEncodable, RustcDecodable)]
2220
pub enum ErrorHandled {
2321
/// Already reported a lint or an error for this evaluation.

src/librustc/traits/error_reporting/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ use rustc_span::{ExpnKind, Span, DUMMY_SP};
3030
use std::fmt;
3131
use syntax::ast;
3232

33-
use rustc_error_codes::*;
34-
3533
impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
3634
pub fn report_fulfillment_errors(
3735
&self,

src/librustc/traits/error_reporting/suggestions.rs

-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ use rustc_span::symbol::{kw, sym};
2020
use rustc_span::{MultiSpan, Span, DUMMY_SP};
2121
use std::fmt;
2222

23-
use rustc_error_codes::*;
24-
2523
impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
2624
crate fn suggest_restricting_param_bound(
2725
&self,

src/librustc/traits/on_unimplemented.rs

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ use rustc_span::Span;
1111
use syntax::ast::{MetaItem, NestedMetaItem};
1212
use syntax::attr;
1313

14-
use rustc_error_codes::*;
15-
1614
#[derive(Clone, Debug)]
1715
pub struct OnUnimplementedFormatString(Symbol);
1816

src/librustc/traits/query/dropck_outlives.rs

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ use crate::ty::{self, Ty, TyCtxt};
66
use rustc_span::source_map::Span;
77
use std::iter::FromIterator;
88

9-
use rustc_error_codes::*;
10-
119
impl<'cx, 'tcx> At<'cx, 'tcx> {
1210
/// Given a type `ty` of some value being dropped, computes a set
1311
/// of "kinds" (types, regions) that must be outlive the execution

src/librustc/traits/specialize/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ use rustc_span::DUMMY_SP;
2525
use super::util::impl_trait_ref_and_oblig;
2626
use super::{FulfillmentContext, SelectionContext};
2727

28-
use rustc_error_codes::*;
29-
3028
/// Information pertinent to an overlapping impl error.
3129
#[derive(Debug)]
3230
pub struct OverlapError {

src/librustc/ty/query/plumbing.rs

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ use std::hash::{Hash, Hasher};
2525
use std::mem;
2626
use std::ptr;
2727

28-
use rustc_error_codes::*;
29-
3028
pub struct QueryCache<'tcx, D: QueryConfig<'tcx> + ?Sized> {
3129
pub(super) results: FxHashMap<D::Key, QueryValue<D::Value>>,
3230
pub(super) active: FxHashMap<D::Key, QueryResult<'tcx>>,

src/librustc_ast_lowering/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ rustc_target = { path = "../librustc_target" }
1717
rustc_data_structures = { path = "../librustc_data_structures" }
1818
rustc_index = { path = "../librustc_index" }
1919
rustc_span = { path = "../librustc_span" }
20-
rustc_error_codes = { path = "../librustc_error_codes" }
2120
rustc_errors = { path = "../librustc_errors" }
2221
rustc_session = { path = "../librustc_session" }
2322
syntax = { path = "../libsyntax" }

src/librustc_ast_lowering/expr.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use super::{ImplTraitContext, LoweringContext, ParamMode, ParenthesizedGenericAr
22

33
use rustc::bug;
44
use rustc_data_structures::thin_vec::ThinVec;
5-
use rustc_error_codes::*;
65
use rustc_errors::struct_span_err;
76
use rustc_hir as hir;
87
use rustc_hir::def::Res;

src/librustc_ast_lowering/item.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use super::{ImplTraitContext, ImplTraitPosition, ImplTraitTypeIdVisitor};
33

44
use rustc::arena::Arena;
55
use rustc::bug;
6-
use rustc_error_codes::*;
76
use rustc_errors::struct_span_err;
87
use rustc_hir as hir;
98
use rustc_hir::def::{DefKind, Res};

src/librustc_ast_lowering/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ use rustc::{bug, span_bug};
4141
use rustc_data_structures::captures::Captures;
4242
use rustc_data_structures::fx::FxHashSet;
4343
use rustc_data_structures::sync::Lrc;
44-
use rustc_error_codes::*;
4544
use rustc_errors::struct_span_err;
4645
use rustc_hir as hir;
4746
use rustc_hir::def::{DefKind, Namespace, PartialRes, PerNS, Res};

src/librustc_ast_lowering/path.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use super::{GenericArgsCtor, ParenthesizedGenericArgs};
33

44
use rustc::lint::builtin::ELIDED_LIFETIMES_IN_PATHS;
55
use rustc::span_bug;
6-
use rustc_error_codes::*;
76
use rustc_errors::{struct_span_err, Applicability};
87
use rustc_hir as hir;
98
use rustc_hir::def::{DefKind, PartialRes, Res};

src/librustc_ast_passes/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ path = "lib.rs"
1212
log = "0.4"
1313
rustc_data_structures = { path = "../librustc_data_structures" }
1414
rustc_errors = { path = "../librustc_errors" }
15-
rustc_error_codes = { path = "../librustc_error_codes" }
1615
rustc_feature = { path = "../librustc_feature" }
1716
rustc_parse = { path = "../librustc_parse" }
1817
rustc_session = { path = "../librustc_session" }

src/librustc_ast_passes/ast_validation.rs

-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ use syntax::print::pprust;
2323
use syntax::visit::{self, Visitor};
2424
use syntax::walk_list;
2525

26-
use rustc_error_codes::*;
27-
2826
/// A syntactic context that disallows certain kinds of bounds (e.g., `?Trait` or `?const Trait`).
2927
#[derive(Clone, Copy)]
3028
enum BoundContext {

src/librustc_ast_passes/feature_gate.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use rustc_error_codes::*;
21
use rustc_errors::{struct_span_err, Handler};
32
use rustc_feature::{AttributeGate, BUILTIN_ATTRIBUTE_MAP};
43
use rustc_feature::{Features, GateIssue, UnstableFeatures};

src/librustc_builtin_macros/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ smallvec = { version = "1.0", features = ["union", "may_dangle"] }
2222
syntax = { path = "../libsyntax" }
2323
rustc_expand = { path = "../librustc_expand" }
2424
rustc_span = { path = "../librustc_span" }
25-
rustc_error_codes = { path = "../librustc_error_codes" }

src/librustc_builtin_macros/asm.rs

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ use syntax::ptr::P;
1212
use syntax::token::{self, Token};
1313
use syntax::tokenstream::{self, TokenStream};
1414

15-
use rustc_error_codes::*;
16-
1715
enum State {
1816
Asm,
1917
Outputs,

src/librustc_builtin_macros/deriving/default.rs

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ use rustc_span::Span;
99
use syntax::ast::{Expr, MetaItem};
1010
use syntax::ptr::P;
1111

12-
use rustc_error_codes::*;
13-
1412
pub fn expand_deriving_default(
1513
cx: &mut ExtCtxt<'_>,
1614
span: Span,

src/librustc_codegen_ssa/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,4 @@ rustc_hir = { path = "../librustc_hir" }
3232
rustc_incremental = { path = "../librustc_incremental" }
3333
rustc_index = { path = "../librustc_index" }
3434
rustc_target = { path = "../librustc_target" }
35-
rustc_error_codes = { path = "../librustc_error_codes" }
3635
rustc_session = { path = "../librustc_session" }

0 commit comments

Comments
 (0)