diff --git a/Cargo.lock b/Cargo.lock index 72f3077d2be40..c3f91dae36bae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2196,7 +2196,8 @@ dependencies = [ "rustc_incremental 0.0.0", "rustc_mir 0.0.0", "rustc_target 0.0.0", - "serialize 0.0.0", + "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "syntax 0.0.0", "syntax_pos 0.0.0", ] @@ -2223,6 +2224,7 @@ version = "0.0.0" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2239,6 +2241,8 @@ dependencies = [ "rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-rayon-core 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_cratesio_shim 0.0.0", + "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serialize 0.0.0", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "stable_deref_trait 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2273,6 +2277,7 @@ dependencies = [ "rustc_traits 0.0.0", "rustc_typeck 0.0.0", "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "serialize 0.0.0", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "syntax 0.0.0", @@ -2288,6 +2293,8 @@ dependencies = [ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_cratesio_shim 0.0.0", "rustc_data_structures 0.0.0", + "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serialize 0.0.0", "syntax_pos 0.0.0", "termcolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2476,6 +2483,9 @@ dependencies = [ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_cratesio_shim 0.0.0", "rustc_data_structures 0.0.0", + "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "serialize 0.0.0", ] @@ -2541,6 +2551,8 @@ dependencies = [ "minifier 0.0.20 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2874,6 +2886,9 @@ dependencies = [ "rustc_errors 0.0.0", "rustc_target 0.0.0", "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "serialize 0.0.0", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "syntax_pos 0.0.0", @@ -2901,6 +2916,8 @@ dependencies = [ "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_data_structures 0.0.0", "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serialize 0.0.0", "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs index d18a48e5d2270..e0e124fb4831f 100644 --- a/src/bootstrap/bin/rustc.rs +++ b/src/bootstrap/bin/rustc.rs @@ -268,13 +268,6 @@ fn main() { } } - // Force all crates compiled by this compiler to (a) be unstable and (b) - // allow the `rustc_private` feature to link to other unstable crates - // also in the sysroot. - if env::var_os("RUSTC_FORCE_UNSTABLE").is_some() { - cmd.arg("-Z").arg("force-unstable-if-unmarked"); - } - if let Ok(map) = env::var("RUSTC_DEBUGINFO_MAP") { cmd.arg("--remap-path-prefix").arg(&map); } @@ -294,6 +287,13 @@ fn main() { } } + // Force all crates compiled by this compiler to (a) be unstable and (b) + // allow the `rustc_private` feature to link to other unstable crates + // also in the sysroot. + if env::var_os("RUSTC_FORCE_UNSTABLE").is_some() { + cmd.arg("-Z").arg("force-unstable-if-unmarked"); + } + if env::var_os("RUSTC_PARALLEL_QUERIES").is_some() { cmd.arg("--cfg").arg("parallel_queries"); } diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index b6bb11d07ef04..4f290f6664ea8 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -1064,15 +1064,9 @@ pub fn run_cargo(builder: &Builder, let filename = Path::new(&*filename); - // If this was an output file in the "host dir" we don't actually - // worry about it, it's not relevant for us. - if filename.starts_with(&host_root_dir) { - continue; - } - // If this was output in the `deps` dir then this is a precise file // name (hash included) so we start tracking it. - if filename.starts_with(&target_deps_dir) { + if filename.starts_with(&host_root_dir) || filename.starts_with(&target_deps_dir) { deps.push(filename.to_path_buf()); continue; } diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index 1674320165e65..135223d20e4f1 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -150,7 +150,7 @@ pub const DUMMY_HIR_ID: HirId = HirId { pub const DUMMY_ITEM_LOCAL_ID: ItemLocalId = ItemLocalId::MAX; -#[derive(Clone, RustcEncodable, RustcDecodable, Copy)] +#[derive(Clone, Copy)] pub struct Label { pub ident: Ident, } @@ -161,7 +161,7 @@ impl fmt::Debug for Label { } } -#[derive(Clone, RustcEncodable, RustcDecodable, Copy)] +#[derive(Clone, Copy)] pub struct Lifetime { pub id: NodeId, pub span: Span, @@ -175,7 +175,7 @@ pub struct Lifetime { pub name: LifetimeName, } -#[derive(Debug, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, Copy)] pub enum ParamName { /// Some user-given name like `T` or `'x`. Plain(Ident), @@ -217,7 +217,7 @@ impl ParamName { } } -#[derive(Debug, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, Copy)] pub enum LifetimeName { /// User-given names or fresh (synthetic) names. Param(ParamName), @@ -300,7 +300,7 @@ impl Lifetime { /// A "Path" is essentially Rust's notion of a name; for instance: /// `std::cmp::PartialEq`. It's represented as a sequence of identifiers, /// along with a bunch of supporting information. -#[derive(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone)] pub struct Path { pub span: Span, /// The definition that the path resolved to. @@ -329,7 +329,7 @@ impl fmt::Display for Path { /// A segment of a path: an identifier, an optional lifetime, and a set of /// types. -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub struct PathSegment { /// The identifier portion of this path segment. pub ident: Ident, @@ -401,7 +401,7 @@ impl PathSegment { } } -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub enum GenericArg { Lifetime(Lifetime), Type(Ty), @@ -423,7 +423,7 @@ impl GenericArg { } } -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub struct GenericArgs { /// The generic arguments for this path segment. pub args: HirVec, @@ -485,7 +485,7 @@ impl GenericArgs { /// A modifier on a bound, currently this is only used for `?Sized`, where the /// modifier is `Maybe`. Negative bounds should also be handled here. -#[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] pub enum TraitBoundModifier { None, Maybe, @@ -495,7 +495,7 @@ pub enum TraitBoundModifier { /// `typeck::collect::compute_bounds` matches these against /// the "special" built-in traits (see `middle::lang_items`) and /// detects `Copy`, `Send` and `Sync`. -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub enum GenericBound { Trait(PolyTraitRef, TraitBoundModifier), Outlives(Lifetime), @@ -512,7 +512,7 @@ impl GenericBound { pub type GenericBounds = HirVec; -#[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Debug)] +#[derive(Copy, Clone, PartialEq, Eq, Debug)] pub enum LifetimeParamKind { // Indicates that the lifetime definition was explicitly declared, like: // `fn foo<'a>(x: &'a u8) -> &'a u8 { x }` @@ -531,7 +531,7 @@ pub enum LifetimeParamKind { Error, } -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub enum GenericParamKind { /// A lifetime definition, eg `'a: 'b + 'c + 'd`. Lifetime { @@ -543,7 +543,7 @@ pub enum GenericParamKind { } } -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub struct GenericParam { pub id: NodeId, pub name: ParamName, @@ -563,7 +563,7 @@ pub struct GenericParamCount { /// Represents lifetimes and type parameters attached to a declaration /// of a function, enum, trait, etc. -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub struct Generics { pub params: HirVec, pub where_clause: WhereClause, @@ -616,7 +616,7 @@ pub enum SyntheticTyParamKind { } /// A `where` clause in a definition -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub struct WhereClause { pub id: NodeId, pub predicates: HirVec, @@ -635,7 +635,7 @@ impl WhereClause { } /// A single predicate in a `where` clause -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub enum WherePredicate { /// A type binding, eg `for<'c> Foo: Send+Clone+'c` BoundPredicate(WhereBoundPredicate), @@ -656,7 +656,7 @@ impl WherePredicate { } /// A type bound, eg `for<'c> Foo: Send+Clone+'c` -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub struct WhereBoundPredicate { pub span: Span, /// Any generics from a `for` binding @@ -668,7 +668,7 @@ pub struct WhereBoundPredicate { } /// A lifetime predicate, e.g. `'a: 'b+'c` -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub struct WhereRegionPredicate { pub span: Span, pub lifetime: Lifetime, @@ -676,7 +676,7 @@ pub struct WhereRegionPredicate { } /// An equality predicate (unsupported), e.g. `T=int` -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub struct WhereEqPredicate { pub id: NodeId, pub span: Span, @@ -690,7 +690,7 @@ pub struct WhereEqPredicate { /// For more details, see the [rustc guide]. /// /// [rustc guide]: https://rust-lang.github.io/rustc-guide/hir.html -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub struct Crate { pub module: Mod, pub attrs: HirVec, @@ -788,7 +788,7 @@ impl Crate { /// A macro definition, in this crate or imported from another. /// /// Not parsed directly, but created on macro import or `macro_rules!` expansion. -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub struct MacroDef { pub name: Name, pub vis: Visibility, @@ -799,7 +799,7 @@ pub struct MacroDef { pub legacy: bool, } -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub struct Block { /// Statements in a block pub stmts: HirVec, @@ -822,7 +822,7 @@ pub struct Block { pub recovered: bool, } -#[derive(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone)] pub struct Pat { pub id: NodeId, pub hir_id: HirId, @@ -885,7 +885,7 @@ impl Pat { /// Patterns like the fields of Foo `{ x, ref y, ref mut z }` /// are treated the same as` x: x, y: ref y, z: ref mut z`, /// except is_shorthand is true -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub struct FieldPat { pub id: NodeId, /// The identifier for the field @@ -898,7 +898,7 @@ pub struct FieldPat { /// Explicit binding annotations given in the HIR for a binding. Note /// that this is not the final binding *mode* that we infer after type /// inference. -#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Copy)] +#[derive(Clone, PartialEq, Debug, Copy)] pub enum BindingAnnotation { /// No binding annotation given: this means that the final binding mode /// will depend on whether we have skipped through a `&` reference @@ -919,13 +919,13 @@ pub enum BindingAnnotation { RefMut, } -#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug)] +#[derive(Copy, Clone, PartialEq, Debug)] pub enum RangeEnd { Included, Excluded, } -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub enum PatKind { /// Represents a wildcard pattern (`_`) Wild, @@ -981,7 +981,7 @@ impl Mutability { } } -#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Copy, Hash)] +#[derive(Clone, PartialEq, Debug, Copy, Hash)] pub enum BinOpKind { /// The `+` operator (addition) Add, @@ -1115,7 +1115,7 @@ impl Into for BinOpKind { pub type BinOp = Spanned; -#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Copy, Hash)] +#[derive(Clone, PartialEq, Debug, Copy, Hash)] pub enum UnOp { /// The `*` operator for dereferencing UnDeref, @@ -1157,7 +1157,7 @@ impl fmt::Debug for StmtKind { } } -#[derive(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone)] pub enum StmtKind { /// Could be an item or a local (let) binding: Decl(P, NodeId), @@ -1188,7 +1188,7 @@ impl StmtKind { } /// Local represents a `let` statement, e.g., `let : = ;` -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub struct Local { pub pat: P, pub ty: Option>, @@ -1203,7 +1203,7 @@ pub struct Local { pub type Decl = Spanned; -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub enum DeclKind { /// A local (let) binding: Local(P), @@ -1228,7 +1228,7 @@ impl DeclKind { } /// represents one arm of a 'match' -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub struct Arm { pub attrs: HirVec, pub pats: HirVec>, @@ -1236,12 +1236,12 @@ pub struct Arm { pub body: P, } -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub enum Guard { If(P), } -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub struct Field { pub id: NodeId, pub ident: Ident, @@ -1250,7 +1250,7 @@ pub struct Field { pub is_shorthand: bool, } -#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Copy)] +#[derive(Clone, PartialEq, Debug, Copy)] pub enum BlockCheckMode { DefaultBlock, UnsafeBlock(UnsafeSource), @@ -1258,13 +1258,13 @@ pub enum BlockCheckMode { PopUnsafeBlock(UnsafeSource), } -#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Copy)] +#[derive(Clone, PartialEq, Debug, Copy)] pub enum UnsafeSource { CompilerGenerated, UserProvided, } -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, RustcEncodable, RustcDecodable, Hash, Debug)] +#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] pub struct BodyId { pub node_id: NodeId, } @@ -1290,7 +1290,7 @@ pub struct BodyId { /// /// All bodies have an **owner**, which can be accessed via the HIR /// map using `body_owner_def_id()`. -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub struct Body { pub arguments: HirVec, pub value: Expr, @@ -1322,7 +1322,7 @@ pub enum BodyOwnerKind { /// These are usually found nested inside types (e.g. array lengths) /// or expressions (e.g. repeat counts), and also used to define /// explicit discriminant values for enum variants. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, PartialEq, Eq, Debug)] pub struct AnonConst { pub id: NodeId, pub hir_id: HirId, @@ -1330,7 +1330,7 @@ pub struct AnonConst { } /// An expression -#[derive(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone)] pub struct Expr { pub id: NodeId, pub span: Span, @@ -1434,7 +1434,7 @@ impl fmt::Debug for Expr { } } -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub enum ExprKind { /// A `box x` expression. Box(P), @@ -1536,7 +1536,7 @@ pub enum ExprKind { } /// Optionally `Self`-qualified value/type path or associated extension. -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +#[derive(Clone, Debug)] pub enum QPath { /// Path to a definition, optionally "fully-qualified" with a `Self` /// type, if the path points to an associated item in a trait. @@ -1556,7 +1556,7 @@ pub enum QPath { } /// Hints at the original code for a let statement -#[derive(Clone, RustcEncodable, RustcDecodable, Debug, Copy)] +#[derive(Clone, Debug, Copy)] pub enum LocalSource { /// A `match _ { .. }` Normal, @@ -1565,7 +1565,7 @@ pub enum LocalSource { } /// Hints at the original code for a `match _ { .. }` -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] +#[derive(Clone, PartialEq, Eq, Hash, Debug, Copy)] pub enum MatchSource { /// A `match _ { .. }` Normal, @@ -1583,7 +1583,7 @@ pub enum MatchSource { } /// The loop type that yielded an ExprKind::Loop -#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Copy)] +#[derive(Clone, PartialEq, Debug, Copy)] pub enum LoopSource { /// A `loop { .. }` loop Loop, @@ -1593,7 +1593,7 @@ pub enum LoopSource { ForLoop, } -#[derive(Clone, RustcEncodable, RustcDecodable, Debug, Copy)] +#[derive(Clone, Debug, Copy)] pub enum LoopIdError { OutsideLoopScope, UnlabeledCfInWhileCondition, @@ -1611,7 +1611,7 @@ impl fmt::Display for LoopIdError { } } -#[derive(Clone, RustcEncodable, RustcDecodable, Debug, Copy)] +#[derive(Clone, Debug, Copy)] pub struct Destination { // This is `Some(_)` iff there is an explicit user-specified `label pub label: Option