Remove many unnecessary trait derivations.
This commit is contained in:
parent
c3b3a86124
commit
ac6daed384
49 changed files with 89 additions and 103 deletions
|
@ -35,7 +35,7 @@ impl DepNodeIndex {
|
||||||
pub const INVALID: DepNodeIndex = DepNodeIndex::MAX;
|
pub const INVALID: DepNodeIndex = DepNodeIndex::MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
#[derive(PartialEq)]
|
||||||
pub enum DepNodeColor {
|
pub enum DepNodeColor {
|
||||||
Red,
|
Red,
|
||||||
Green(DepNodeIndex)
|
Green(DepNodeIndex)
|
||||||
|
|
|
@ -599,7 +599,6 @@ macro_rules! define_global_metadata_kind {
|
||||||
(pub enum GlobalMetaDataKind {
|
(pub enum GlobalMetaDataKind {
|
||||||
$($variant:ident),*
|
$($variant:ident),*
|
||||||
}) => (
|
}) => (
|
||||||
#[derive(Clone, Copy, Debug, Hash, RustcEncodable, RustcDecodable)]
|
|
||||||
pub enum GlobalMetaDataKind {
|
pub enum GlobalMetaDataKind {
|
||||||
$($variant),*
|
$($variant),*
|
||||||
}
|
}
|
||||||
|
|
|
@ -1077,7 +1077,7 @@ impl Mutability {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Hash, HashStable)]
|
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, HashStable)]
|
||||||
pub enum BinOpKind {
|
pub enum BinOpKind {
|
||||||
/// The `+` operator (addition).
|
/// The `+` operator (addition).
|
||||||
Add,
|
Add,
|
||||||
|
@ -1211,7 +1211,7 @@ impl Into<ast::BinOpKind> for BinOpKind {
|
||||||
|
|
||||||
pub type BinOp = Spanned<BinOpKind>;
|
pub type BinOp = Spanned<BinOpKind>;
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Hash, HashStable)]
|
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, HashStable)]
|
||||||
pub enum UnOp {
|
pub enum UnOp {
|
||||||
/// The `*` operator (deferencing).
|
/// The `*` operator (deferencing).
|
||||||
UnDeref,
|
UnDeref,
|
||||||
|
@ -1388,8 +1388,7 @@ impl Body {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The type of source expression that caused this generator to be created.
|
/// The type of source expression that caused this generator to be created.
|
||||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, HashStable,
|
#[derive(Clone, PartialEq, Eq, HashStable, RustcEncodable, RustcDecodable, Debug, Copy)]
|
||||||
RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
|
|
||||||
pub enum GeneratorKind {
|
pub enum GeneratorKind {
|
||||||
/// An explicit `async` block or the body of an async function.
|
/// An explicit `async` block or the body of an async function.
|
||||||
Async(AsyncGeneratorKind),
|
Async(AsyncGeneratorKind),
|
||||||
|
@ -1412,8 +1411,7 @@ impl fmt::Display for GeneratorKind {
|
||||||
///
|
///
|
||||||
/// This helps error messages but is also used to drive coercions in
|
/// This helps error messages but is also used to drive coercions in
|
||||||
/// type-checking (see #60424).
|
/// type-checking (see #60424).
|
||||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, HashStable,
|
#[derive(Clone, PartialEq, Eq, HashStable, RustcEncodable, RustcDecodable, Debug, Copy)]
|
||||||
RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
|
|
||||||
pub enum AsyncGeneratorKind {
|
pub enum AsyncGeneratorKind {
|
||||||
/// An explicit `async` block written by the user.
|
/// An explicit `async` block written by the user.
|
||||||
Block,
|
Block,
|
||||||
|
|
|
@ -11,7 +11,7 @@ use rustc_serialize::{Encodable, Decodable, Encoder, Decoder};
|
||||||
|
|
||||||
use rustc_data_structures::stable_hasher::{StableHasher, HashStable};
|
use rustc_data_structures::stable_hasher::{StableHasher, HashStable};
|
||||||
/// An owned smart pointer.
|
/// An owned smart pointer.
|
||||||
#[derive(Hash, PartialEq, Eq)]
|
#[derive(PartialEq, Eq)]
|
||||||
pub struct P<T: ?Sized> {
|
pub struct P<T: ?Sized> {
|
||||||
ptr: Box<T>
|
ptr: Box<T>
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ pub struct CanonicalVarValues<'tcx> {
|
||||||
/// various parts of it with canonical variables. This struct stores
|
/// various parts of it with canonical variables. This struct stores
|
||||||
/// those replaced bits to remember for when we process the query
|
/// those replaced bits to remember for when we process the query
|
||||||
/// result.
|
/// result.
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, RustcDecodable, RustcEncodable)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct OriginalQueryValues<'tcx> {
|
pub struct OriginalQueryValues<'tcx> {
|
||||||
/// Map from the universes that appear in the query to the
|
/// Map from the universes that appear in the query to the
|
||||||
/// universes in the caller context. For the time being, we only
|
/// universes in the caller context. For the time being, we only
|
||||||
|
|
|
@ -53,7 +53,7 @@ pub struct CombineFields<'infcx, 'tcx> {
|
||||||
pub obligations: PredicateObligations<'tcx>,
|
pub obligations: PredicateObligations<'tcx>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub enum RelationDir {
|
pub enum RelationDir {
|
||||||
SubtypeOf, SupertypeOf, EqTo
|
SubtypeOf, SupertypeOf, EqTo
|
||||||
}
|
}
|
||||||
|
|
|
@ -407,7 +407,7 @@ pub enum RegionVariableOrigin {
|
||||||
NLL(NLLRegionVariableOrigin),
|
NLL(NLLRegionVariableOrigin),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub enum NLLRegionVariableOrigin {
|
pub enum NLLRegionVariableOrigin {
|
||||||
/// During NLL region processing, we create variables for free
|
/// During NLL region processing, we create variables for free
|
||||||
/// regions that we encounter in the function signature and
|
/// regions that we encounter in the function signature and
|
||||||
|
|
|
@ -32,7 +32,7 @@ use crate::mir::interpret::ConstValue;
|
||||||
use rustc_data_structures::fx::FxHashMap;
|
use rustc_data_structures::fx::FxHashMap;
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
|
#[derive(PartialEq)]
|
||||||
pub enum NormalizationStrategy {
|
pub enum NormalizationStrategy {
|
||||||
Lazy,
|
Lazy,
|
||||||
Eager,
|
Eager,
|
||||||
|
|
|
@ -116,7 +116,7 @@ pub struct RegionConstraintData<'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Represents a constraint that influences the inference process.
|
/// Represents a constraint that influences the inference process.
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, PartialOrd, Ord)]
|
#[derive(Clone, Copy, PartialEq, Eq, Debug, PartialOrd, Ord)]
|
||||||
pub enum Constraint<'tcx> {
|
pub enum Constraint<'tcx> {
|
||||||
/// A region variable is a subregion of another.
|
/// A region variable is a subregion of another.
|
||||||
VarSubVar(RegionVid, RegionVid),
|
VarSubVar(RegionVid, RegionVid),
|
||||||
|
|
|
@ -117,7 +117,7 @@ pub struct NativeLibrary {
|
||||||
pub wasm_import_module: Option<Symbol>,
|
pub wasm_import_module: Option<Symbol>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Hash, RustcEncodable, RustcDecodable, HashStable)]
|
#[derive(Clone, RustcEncodable, RustcDecodable, HashStable)]
|
||||||
pub struct ForeignModule {
|
pub struct ForeignModule {
|
||||||
pub foreign_items: Vec<DefId>,
|
pub foreign_items: Vec<DefId>,
|
||||||
pub def_id: DefId,
|
pub def_id: DefId,
|
||||||
|
|
|
@ -102,7 +102,7 @@ pub struct Upvar {
|
||||||
}
|
}
|
||||||
|
|
||||||
// different kinds of pointers:
|
// different kinds of pointers:
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||||
pub enum PointerKind<'tcx> {
|
pub enum PointerKind<'tcx> {
|
||||||
/// `Box<T>`
|
/// `Box<T>`
|
||||||
Unique,
|
Unique,
|
||||||
|
@ -116,7 +116,7 @@ pub enum PointerKind<'tcx> {
|
||||||
|
|
||||||
// We use the term "interior" to mean "something reachable from the
|
// We use the term "interior" to mean "something reachable from the
|
||||||
// base without a pointer dereference", e.g., a field
|
// base without a pointer dereference", e.g., a field
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
|
#[derive(Clone, PartialEq)]
|
||||||
pub enum InteriorKind {
|
pub enum InteriorKind {
|
||||||
InteriorField(FieldIndex),
|
InteriorField(FieldIndex),
|
||||||
InteriorElement(InteriorOffsetKind),
|
InteriorElement(InteriorOffsetKind),
|
||||||
|
@ -139,13 +139,13 @@ impl Hash for FieldIndex {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
|
#[derive(Clone, PartialEq)]
|
||||||
pub enum InteriorOffsetKind {
|
pub enum InteriorOffsetKind {
|
||||||
Index, // e.g., `array_expr[index_expr]`
|
Index, // e.g., `array_expr[index_expr]`
|
||||||
Pattern, // e.g., `fn foo([_, a, _, _]: [A; 4]) { ... }`
|
Pattern, // e.g., `fn foo([_, a, _, _]: [A; 4]) { ... }`
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
|
#[derive(Clone, Copy, PartialEq, Debug)]
|
||||||
pub enum MutabilityCategory {
|
pub enum MutabilityCategory {
|
||||||
McImmutable, // Immutable.
|
McImmutable, // Immutable.
|
||||||
McDeclared, // Directly declared as mutable.
|
McDeclared, // Directly declared as mutable.
|
||||||
|
|
|
@ -25,7 +25,7 @@ use crate::util::nodemap::{FxHashSet, FxHashMap};
|
||||||
use std::mem::replace;
|
use std::mem::replace;
|
||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
|
|
||||||
#[derive(RustcEncodable, RustcDecodable, PartialEq, PartialOrd, Clone, Copy, Debug, Eq, Hash)]
|
#[derive(PartialEq, Clone, Copy, Debug)]
|
||||||
pub enum StabilityLevel {
|
pub enum StabilityLevel {
|
||||||
Unstable,
|
Unstable,
|
||||||
Stable,
|
Stable,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::hir::def_id::DefId;
|
||||||
use super::{InterpResult, Pointer, PointerArithmetic, Allocation, AllocId, sign_extend, truncate};
|
use super::{InterpResult, Pointer, PointerArithmetic, Allocation, AllocId, sign_extend, truncate};
|
||||||
|
|
||||||
/// Represents the result of a raw const operation, pre-validation.
|
/// Represents the result of a raw const operation, pre-validation.
|
||||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, RustcEncodable, RustcDecodable, Hash, HashStable)]
|
#[derive(Clone, HashStable)]
|
||||||
pub struct RawConst<'tcx> {
|
pub struct RawConst<'tcx> {
|
||||||
// the value lives here, at offset 0, and that allocation definitely is a `AllocKind::Memory`
|
// the value lives here, at offset 0, and that allocation definitely is a `AllocKind::Memory`
|
||||||
// (so you can use `AllocMap::unwrap_memory`).
|
// (so you can use `AllocMap::unwrap_memory`).
|
||||||
|
@ -487,7 +487,7 @@ impl<Tag> From<Pointer<Tag>> for Scalar<Tag> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash, RustcEncodable, RustcDecodable)]
|
#[derive(Clone, Copy, Eq, PartialEq, RustcEncodable, RustcDecodable)]
|
||||||
pub enum ScalarMaybeUndef<Tag = (), Id = AllocId> {
|
pub enum ScalarMaybeUndef<Tag = (), Id = AllocId> {
|
||||||
Scalar(Scalar<Tag, Id>),
|
Scalar(Scalar<Tag, Id>),
|
||||||
Undef,
|
Undef,
|
||||||
|
|
|
@ -468,7 +468,7 @@ impl<T: Decodable> rustc_serialize::UseSpecializedDecodable for ClearCrossCrate<
|
||||||
/// Grouped information about the source code origin of a MIR entity.
|
/// Grouped information about the source code origin of a MIR entity.
|
||||||
/// Intended to be inspected by diagnostics and debuginfo.
|
/// Intended to be inspected by diagnostics and debuginfo.
|
||||||
/// Most passes can work with it as a whole, within a single function.
|
/// Most passes can work with it as a whole, within a single function.
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, HashStable)]
|
#[derive(Copy, Clone, Debug, PartialEq, RustcEncodable, RustcDecodable, HashStable)]
|
||||||
pub struct SourceInfo {
|
pub struct SourceInfo {
|
||||||
/// The source span for the AST pertaining to this MIR entity.
|
/// The source span for the AST pertaining to this MIR entity.
|
||||||
pub span: Span,
|
pub span: Span,
|
||||||
|
@ -608,7 +608,7 @@ pub enum LocalKind {
|
||||||
ReturnPointer,
|
ReturnPointer,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Hash, Debug, RustcEncodable, RustcDecodable)]
|
#[derive(Clone, Debug, RustcEncodable, RustcDecodable)]
|
||||||
pub struct VarBindingForm<'tcx> {
|
pub struct VarBindingForm<'tcx> {
|
||||||
/// Is variable bound via `x`, `mut x`, `ref x`, or `ref mut x`?
|
/// Is variable bound via `x`, `mut x`, `ref x`, or `ref mut x`?
|
||||||
pub binding_mode: ty::BindingMode,
|
pub binding_mode: ty::BindingMode,
|
||||||
|
@ -630,7 +630,7 @@ pub struct VarBindingForm<'tcx> {
|
||||||
pub pat_span: Span,
|
pub pat_span: Span,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Hash, Debug, RustcEncodable, RustcDecodable)]
|
#[derive(Clone, Debug, RustcEncodable, RustcDecodable)]
|
||||||
pub enum BindingForm<'tcx> {
|
pub enum BindingForm<'tcx> {
|
||||||
/// This is a binding for a non-`self` binding, or a `self` that has an explicit type.
|
/// This is a binding for a non-`self` binding, or a `self` that has an explicit type.
|
||||||
Var(VarBindingForm<'tcx>),
|
Var(VarBindingForm<'tcx>),
|
||||||
|
@ -641,7 +641,7 @@ pub enum BindingForm<'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Represents what type of implicit self a function has, if any.
|
/// Represents what type of implicit self a function has, if any.
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, RustcEncodable, RustcDecodable)]
|
#[derive(Clone, Copy, PartialEq, Debug, RustcEncodable, RustcDecodable)]
|
||||||
pub enum ImplicitSelfKind {
|
pub enum ImplicitSelfKind {
|
||||||
/// Represents a `fn x(self);`.
|
/// Represents a `fn x(self);`.
|
||||||
Imm,
|
Imm,
|
||||||
|
@ -2392,7 +2392,7 @@ impl<'tcx> Debug for Rvalue<'tcx> {
|
||||||
/// this does not necessarily mean that they are "==" in Rust -- in
|
/// this does not necessarily mean that they are "==" in Rust -- in
|
||||||
/// particular one must be wary of `NaN`!
|
/// particular one must be wary of `NaN`!
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, HashStable)]
|
#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, HashStable)]
|
||||||
pub struct Constant<'tcx> {
|
pub struct Constant<'tcx> {
|
||||||
pub span: Span,
|
pub span: Span,
|
||||||
|
|
||||||
|
@ -2438,7 +2438,7 @@ pub struct Constant<'tcx> {
|
||||||
/// The first will lead to the constraint `w: &'1 str` (for some
|
/// The first will lead to the constraint `w: &'1 str` (for some
|
||||||
/// inferred region `'1`). The second will lead to the constraint `w:
|
/// inferred region `'1`). The second will lead to the constraint `w:
|
||||||
/// &'static str`.
|
/// &'static str`.
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, HashStable)]
|
#[derive(Clone, Debug, RustcEncodable, RustcDecodable, HashStable)]
|
||||||
pub struct UserTypeProjections {
|
pub struct UserTypeProjections {
|
||||||
pub(crate) contents: Vec<(UserTypeProjection, Span)>,
|
pub(crate) contents: Vec<(UserTypeProjection, Span)>,
|
||||||
}
|
}
|
||||||
|
@ -2515,7 +2515,7 @@ impl<'tcx> UserTypeProjections {
|
||||||
/// * `let (x, _): T = ...` -- here, the `projs` vector would contain
|
/// * `let (x, _): T = ...` -- here, the `projs` vector would contain
|
||||||
/// `field[0]` (aka `.0`), indicating that the type of `s` is
|
/// `field[0]` (aka `.0`), indicating that the type of `s` is
|
||||||
/// determined by finding the type of the `.0` field from `T`.
|
/// determined by finding the type of the `.0` field from `T`.
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, HashStable)]
|
#[derive(Clone, Debug, RustcEncodable, RustcDecodable, HashStable)]
|
||||||
pub struct UserTypeProjection {
|
pub struct UserTypeProjection {
|
||||||
pub base: UserTypeAnnotationIndex,
|
pub base: UserTypeAnnotationIndex,
|
||||||
pub projs: Vec<ProjectionKind>,
|
pub projs: Vec<ProjectionKind>,
|
||||||
|
@ -2724,7 +2724,7 @@ impl Location {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, HashStable)]
|
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, HashStable)]
|
||||||
pub enum UnsafetyViolationKind {
|
pub enum UnsafetyViolationKind {
|
||||||
General,
|
General,
|
||||||
/// Permitted both in `const fn`s and regular `fn`s.
|
/// Permitted both in `const fn`s and regular `fn`s.
|
||||||
|
@ -2733,7 +2733,7 @@ pub enum UnsafetyViolationKind {
|
||||||
BorrowPacked(hir::HirId),
|
BorrowPacked(hir::HirId),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, HashStable)]
|
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, HashStable)]
|
||||||
pub struct UnsafetyViolation {
|
pub struct UnsafetyViolation {
|
||||||
pub source_info: SourceInfo,
|
pub source_info: SourceInfo,
|
||||||
pub description: InternedString,
|
pub description: InternedString,
|
||||||
|
@ -2741,7 +2741,7 @@ pub struct UnsafetyViolation {
|
||||||
pub kind: UnsafetyViolationKind,
|
pub kind: UnsafetyViolationKind,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, HashStable)]
|
#[derive(Clone, RustcEncodable, RustcDecodable, HashStable)]
|
||||||
pub struct UnsafetyCheckResult {
|
pub struct UnsafetyCheckResult {
|
||||||
/// Violations that are propagated *upwards* from this function.
|
/// Violations that are propagated *upwards* from this function.
|
||||||
pub violations: Lrc<[UnsafetyViolation]>,
|
pub violations: Lrc<[UnsafetyViolation]>,
|
||||||
|
|
|
@ -15,7 +15,7 @@ use std::fmt;
|
||||||
use std::hash::Hash;
|
use std::hash::Hash;
|
||||||
|
|
||||||
/// Describes how a monomorphization will be instantiated in object files.
|
/// Describes how a monomorphization will be instantiated in object files.
|
||||||
#[derive(PartialEq, Eq, Clone, Copy, Debug, Hash)]
|
#[derive(PartialEq)]
|
||||||
pub enum InstantiationMode {
|
pub enum InstantiationMode {
|
||||||
/// There will be exactly one instance of the given MonoItem. It will have
|
/// There will be exactly one instance of the given MonoItem. It will have
|
||||||
/// external linkage so that it can be linked to from other codegen units.
|
/// external linkage so that it can be linked to from other codegen units.
|
||||||
|
@ -251,7 +251,7 @@ pub struct CodegenUnit<'tcx> {
|
||||||
size_estimate: Option<usize>,
|
size_estimate: Option<usize>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, RustcEncodable, RustcDecodable)]
|
#[derive(Copy, Clone, PartialEq, Debug, RustcEncodable, RustcDecodable)]
|
||||||
pub enum Linkage {
|
pub enum Linkage {
|
||||||
External,
|
External,
|
||||||
AvailableExternally,
|
AvailableExternally,
|
||||||
|
@ -280,7 +280,7 @@ impl_stable_hash_for!(enum self::Linkage {
|
||||||
Common
|
Common
|
||||||
});
|
});
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
|
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||||
pub enum Visibility {
|
pub enum Visibility {
|
||||||
Default,
|
Default,
|
||||||
Hidden,
|
Hidden,
|
||||||
|
|
|
@ -947,7 +947,7 @@ impl<'tcx> MirVisitable<'tcx> for Option<Terminator<'tcx>> {
|
||||||
|
|
||||||
/// Extra information passed to `visit_ty` and friends to give context
|
/// Extra information passed to `visit_ty` and friends to give context
|
||||||
/// about where the type etc appears.
|
/// about where the type etc appears.
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
#[derive(Debug)]
|
||||||
pub enum TyContext {
|
pub enum TyContext {
|
||||||
LocalDecl {
|
LocalDecl {
|
||||||
/// The index of the local variable we are visiting.
|
/// The index of the local variable we are visiting.
|
||||||
|
|
|
@ -67,7 +67,7 @@ impl_stable_hash_via_hash!(OptLevel);
|
||||||
|
|
||||||
/// This is what the `LtoCli` values get mapped to after resolving defaults and
|
/// This is what the `LtoCli` values get mapped to after resolving defaults and
|
||||||
/// and taking other command line options into account.
|
/// and taking other command line options into account.
|
||||||
#[derive(Clone, Copy, PartialEq, Hash, Debug)]
|
#[derive(Clone, PartialEq)]
|
||||||
pub enum Lto {
|
pub enum Lto {
|
||||||
/// Don't do any LTO whatsoever
|
/// Don't do any LTO whatsoever
|
||||||
No,
|
No,
|
||||||
|
@ -301,10 +301,10 @@ impl OutputTypes {
|
||||||
/// Use tree-based collections to cheaply get a deterministic `Hash` implementation.
|
/// Use tree-based collections to cheaply get a deterministic `Hash` implementation.
|
||||||
/// *Do not* switch `BTreeMap` or `BTreeSet` out for an unsorted container type! That
|
/// *Do not* switch `BTreeMap` or `BTreeSet` out for an unsorted container type! That
|
||||||
/// would break dependency tracking for command-line arguments.
|
/// would break dependency tracking for command-line arguments.
|
||||||
#[derive(Clone, Hash)]
|
#[derive(Clone)]
|
||||||
pub struct Externs(BTreeMap<String, ExternEntry>);
|
pub struct Externs(BTreeMap<String, ExternEntry>);
|
||||||
|
|
||||||
#[derive(Clone, Hash, Eq, PartialEq, Ord, PartialOrd, Debug, Default)]
|
#[derive(Clone, Debug, Default)]
|
||||||
pub struct ExternEntry {
|
pub struct ExternEntry {
|
||||||
pub locations: BTreeSet<Option<String>>,
|
pub locations: BTreeSet<Option<String>>,
|
||||||
pub is_private_dep: bool
|
pub is_private_dep: bool
|
||||||
|
@ -464,7 +464,7 @@ pub enum PrintRequest {
|
||||||
NativeStaticLibs,
|
NativeStaticLibs,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Copy, Clone)]
|
||||||
pub enum BorrowckMode {
|
pub enum BorrowckMode {
|
||||||
Mir,
|
Mir,
|
||||||
Migrate,
|
Migrate,
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use rustc_macros::HashStable;
|
|
||||||
use crate::session::{early_error, config};
|
use crate::session::{early_error, config};
|
||||||
use crate::session::filesearch::make_target_lib_path;
|
use crate::session::filesearch::make_target_lib_path;
|
||||||
|
|
||||||
|
@ -10,7 +9,7 @@ pub struct SearchPath {
|
||||||
pub files: Vec<PathBuf>,
|
pub files: Vec<PathBuf>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Eq, PartialEq, Clone, Copy, Debug, PartialOrd, Ord, Hash, HashStable)]
|
#[derive(PartialEq, Clone, Copy, Debug, HashStable)]
|
||||||
pub enum PathKind {
|
pub enum PathKind {
|
||||||
Native,
|
Native,
|
||||||
Crate,
|
Crate,
|
||||||
|
|
|
@ -40,7 +40,7 @@ pub type CanonicalTypeOpProvePredicateGoal<'tcx> =
|
||||||
pub type CanonicalTypeOpNormalizeGoal<'tcx, T> =
|
pub type CanonicalTypeOpNormalizeGoal<'tcx, T> =
|
||||||
Canonical<'tcx, ty::ParamEnvAnd<'tcx, type_op::normalize::Normalize<T>>>;
|
Canonical<'tcx, ty::ParamEnvAnd<'tcx, type_op::normalize::Normalize<T>>>;
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct NoSolution;
|
pub struct NoSolution;
|
||||||
|
|
||||||
pub type Fallible<T> = Result<T, NoSolution>;
|
pub type Fallible<T> = Result<T, NoSolution>;
|
||||||
|
|
|
@ -3,7 +3,7 @@ use crate::traits::query::outlives_bounds::OutlivesBound;
|
||||||
use crate::traits::query::Fallible;
|
use crate::traits::query::Fallible;
|
||||||
use crate::ty::{ParamEnvAnd, Ty, TyCtxt};
|
use crate::ty::{ParamEnvAnd, Ty, TyCtxt};
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct ImpliedOutlivesBounds<'tcx> {
|
pub struct ImpliedOutlivesBounds<'tcx> {
|
||||||
pub ty: Ty<'tcx>,
|
pub ty: Ty<'tcx>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ use crate::hir::BindingAnnotation::*;
|
||||||
use crate::hir::BindingAnnotation;
|
use crate::hir::BindingAnnotation;
|
||||||
use crate::hir::Mutability;
|
use crate::hir::Mutability;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
|
#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Copy)]
|
||||||
pub enum BindingMode {
|
pub enum BindingMode {
|
||||||
BindByReference(Mutability),
|
BindByReference(Mutability),
|
||||||
BindByValue(Mutability),
|
BindByValue(Mutability),
|
||||||
|
|
|
@ -827,7 +827,7 @@ rustc_index::newtype_index! {
|
||||||
pub type CanonicalUserTypeAnnotations<'tcx> =
|
pub type CanonicalUserTypeAnnotations<'tcx> =
|
||||||
IndexVec<UserTypeAnnotationIndex, CanonicalUserTypeAnnotation<'tcx>>;
|
IndexVec<UserTypeAnnotationIndex, CanonicalUserTypeAnnotation<'tcx>>;
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, HashStable)]
|
#[derive(Clone, Debug, RustcEncodable, RustcDecodable, HashStable)]
|
||||||
pub struct CanonicalUserTypeAnnotation<'tcx> {
|
pub struct CanonicalUserTypeAnnotation<'tcx> {
|
||||||
pub user_ty: CanonicalUserType<'tcx>,
|
pub user_ty: CanonicalUserType<'tcx>,
|
||||||
pub span: Span,
|
pub span: Span,
|
||||||
|
@ -899,7 +899,7 @@ impl CanonicalUserType<'tcx> {
|
||||||
/// A user-given type annotation attached to a constant. These arise
|
/// A user-given type annotation attached to a constant. These arise
|
||||||
/// from constants that are named via paths, like `Foo::<A>::new` and
|
/// from constants that are named via paths, like `Foo::<A>::new` and
|
||||||
/// so forth.
|
/// so forth.
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, HashStable)]
|
#[derive(Copy, Clone, Debug, PartialEq, RustcEncodable, RustcDecodable, HashStable)]
|
||||||
pub enum UserType<'tcx> {
|
pub enum UserType<'tcx> {
|
||||||
Ty(Ty<'tcx>),
|
Ty(Ty<'tcx>),
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,6 @@ pub enum TypeError<'tcx> {
|
||||||
IntrinsicCast,
|
IntrinsicCast,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Debug, Copy)]
|
|
||||||
pub enum UnconstrainedNumeric {
|
pub enum UnconstrainedNumeric {
|
||||||
UnconstrainedFloat,
|
UnconstrainedFloat,
|
||||||
UnconstrainedInt,
|
UnconstrainedInt,
|
||||||
|
|
|
@ -718,7 +718,6 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||||
// vars. See comment on `shift_vars_through_binders` method in
|
// vars. See comment on `shift_vars_through_binders` method in
|
||||||
// `subst.rs` for more details.
|
// `subst.rs` for more details.
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
|
|
||||||
enum Direction {
|
enum Direction {
|
||||||
In,
|
In,
|
||||||
Out,
|
Out,
|
||||||
|
|
|
@ -159,7 +159,7 @@ impl AssocItemContainer {
|
||||||
/// The "header" of an impl is everything outside the body: a Self type, a trait
|
/// The "header" of an impl is everything outside the body: a Self type, a trait
|
||||||
/// ref (in the case of a trait impl), and a set of predicates (from the
|
/// ref (in the case of a trait impl), and a set of predicates (from the
|
||||||
/// bounds / where-clauses).
|
/// bounds / where-clauses).
|
||||||
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct ImplHeader<'tcx> {
|
pub struct ImplHeader<'tcx> {
|
||||||
pub impl_def_id: DefId,
|
pub impl_def_id: DefId,
|
||||||
pub self_ty: Ty<'tcx>,
|
pub self_ty: Ty<'tcx>,
|
||||||
|
@ -195,7 +195,7 @@ pub struct AssocItem {
|
||||||
pub method_has_self_argument: bool,
|
pub method_has_self_argument: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash, RustcEncodable, RustcDecodable, HashStable)]
|
#[derive(Copy, Clone, PartialEq, Debug, HashStable)]
|
||||||
pub enum AssocKind {
|
pub enum AssocKind {
|
||||||
Const,
|
Const,
|
||||||
Method,
|
Method,
|
||||||
|
@ -331,7 +331,7 @@ impl Visibility {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, RustcDecodable, RustcEncodable, Hash, HashStable)]
|
#[derive(Copy, Clone, PartialEq, RustcDecodable, RustcEncodable, HashStable)]
|
||||||
pub enum Variance {
|
pub enum Variance {
|
||||||
Covariant, // T<A> <: T<B> iff A <: B -- e.g., function return type
|
Covariant, // T<A> <: T<B> iff A <: B -- e.g., function return type
|
||||||
Invariant, // T<A> <: T<B> iff B == A -- e.g., type of mutable cell
|
Invariant, // T<A> <: T<B> iff B == A -- e.g., type of mutable cell
|
||||||
|
@ -752,7 +752,7 @@ pub struct UpvarId {
|
||||||
pub closure_expr_id: LocalDefId,
|
pub closure_expr_id: LocalDefId,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Hash, Debug, RustcEncodable, RustcDecodable, Copy, HashStable)]
|
#[derive(Clone, PartialEq, Debug, RustcEncodable, RustcDecodable, Copy, HashStable)]
|
||||||
pub enum BorrowKind {
|
pub enum BorrowKind {
|
||||||
/// Data must be immutable and is aliasable.
|
/// Data must be immutable and is aliasable.
|
||||||
ImmBorrow,
|
ImmBorrow,
|
||||||
|
|
|
@ -801,7 +801,7 @@ macro_rules! define_queries_inner {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(nonstandard_style)]
|
#[allow(nonstandard_style)]
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
#[derive(Clone, Copy)]
|
||||||
pub enum QueryName {
|
pub enum QueryName {
|
||||||
$($name),*
|
$($name),*
|
||||||
}
|
}
|
||||||
|
@ -819,7 +819,7 @@ macro_rules! define_queries_inner {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(nonstandard_style)]
|
#[allow(nonstandard_style)]
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum Query<$tcx> {
|
pub enum Query<$tcx> {
|
||||||
$($(#[$attr])* $name($K)),*
|
$($(#[$attr])* $name($K)),*
|
||||||
}
|
}
|
||||||
|
|
|
@ -304,8 +304,7 @@ static_assert_size!(TyKind<'_>, 24);
|
||||||
/// type parameters is similar, but the role of CK and CS are
|
/// type parameters is similar, but the role of CK and CS are
|
||||||
/// different. CK represents the "yield type" and CS represents the
|
/// different. CK represents the "yield type" and CS represents the
|
||||||
/// "return type" of the generator.
|
/// "return type" of the generator.
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug,
|
#[derive(Copy, Clone, Debug)]
|
||||||
RustcEncodable, RustcDecodable, HashStable)]
|
|
||||||
pub struct ClosureSubsts<'tcx> {
|
pub struct ClosureSubsts<'tcx> {
|
||||||
/// Lifetime and type parameters from the enclosing function,
|
/// Lifetime and type parameters from the enclosing function,
|
||||||
/// concatenated with the types of the upvars.
|
/// concatenated with the types of the upvars.
|
||||||
|
@ -392,8 +391,7 @@ impl<'tcx> ClosureSubsts<'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Similar to `ClosureSubsts`; see the above documentation for more.
|
/// Similar to `ClosureSubsts`; see the above documentation for more.
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug,
|
#[derive(Copy, Clone, Debug)]
|
||||||
RustcEncodable, RustcDecodable, HashStable)]
|
|
||||||
pub struct GeneratorSubsts<'tcx> {
|
pub struct GeneratorSubsts<'tcx> {
|
||||||
pub substs: SubstsRef<'tcx>,
|
pub substs: SubstsRef<'tcx>,
|
||||||
}
|
}
|
||||||
|
@ -1035,7 +1033,7 @@ impl<'tcx> ProjectionTy<'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, HashStable)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct GenSig<'tcx> {
|
pub struct GenSig<'tcx> {
|
||||||
pub yield_ty: Ty<'tcx>,
|
pub yield_ty: Ty<'tcx>,
|
||||||
pub return_ty: Ty<'tcx>,
|
pub return_ty: Ty<'tcx>,
|
||||||
|
|
|
@ -50,7 +50,7 @@ pub enum CallConv {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// LLVMRustLinkage
|
/// LLVMRustLinkage
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
|
#[derive(PartialEq)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub enum Linkage {
|
pub enum Linkage {
|
||||||
ExternalLinkage = 0,
|
ExternalLinkage = 0,
|
||||||
|
@ -67,7 +67,6 @@ pub enum Linkage {
|
||||||
}
|
}
|
||||||
|
|
||||||
// LLVMRustVisibility
|
// LLVMRustVisibility
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub enum Visibility {
|
pub enum Visibility {
|
||||||
Default = 0,
|
Default = 0,
|
||||||
|
|
|
@ -60,10 +60,10 @@ impl<N> SnapshotVecDelegate for Edge<N> {
|
||||||
fn reverse(_: &mut Vec<Edge<N>>, _: ()) {}
|
fn reverse(_: &mut Vec<Edge<N>>, _: ()) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
|
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||||
pub struct NodeIndex(pub usize);
|
pub struct NodeIndex(pub usize);
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
|
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||||
pub struct EdgeIndex(pub usize);
|
pub struct EdgeIndex(pub usize);
|
||||||
|
|
||||||
pub const INVALID_EDGE_INDEX: EdgeIndex = EdgeIndex(usize::MAX);
|
pub const INVALID_EDGE_INDEX: EdgeIndex = EdgeIndex(usize::MAX);
|
||||||
|
|
|
@ -169,7 +169,7 @@ pub trait HashStable<CTX> {
|
||||||
/// example, for DefId that can be converted to a DefPathHash. This is used for
|
/// example, for DefId that can be converted to a DefPathHash. This is used for
|
||||||
/// bringing maps into a predictable order before hashing them.
|
/// bringing maps into a predictable order before hashing them.
|
||||||
pub trait ToStableHashKey<HCX> {
|
pub trait ToStableHashKey<HCX> {
|
||||||
type KeyType: Ord + Clone + Sized + HashStable<HCX>;
|
type KeyType: Ord + Sized + HashStable<HCX>;
|
||||||
fn to_stable_hash_key(&self, hcx: &HCX) -> Self::KeyType;
|
fn to_stable_hash_key(&self, hcx: &HCX) -> Self::KeyType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -516,7 +516,7 @@ pub fn hash_stable_hashmap<HCX, K, V, R, SK, F>(
|
||||||
where K: Eq,
|
where K: Eq,
|
||||||
V: HashStable<HCX>,
|
V: HashStable<HCX>,
|
||||||
R: BuildHasher,
|
R: BuildHasher,
|
||||||
SK: HashStable<HCX> + Ord + Clone,
|
SK: HashStable<HCX> + Ord,
|
||||||
F: Fn(&K, &HCX) -> SK,
|
F: Fn(&K, &HCX) -> SK,
|
||||||
{
|
{
|
||||||
let mut entries: Vec<_> = map.iter()
|
let mut entries: Vec<_> = map.iter()
|
||||||
|
|
|
@ -738,7 +738,7 @@ impl<T: Clone> Clone for RwLock<T> {
|
||||||
|
|
||||||
/// A type which only allows its inner value to be used in one thread.
|
/// A type which only allows its inner value to be used in one thread.
|
||||||
/// It will panic if it is used on multiple threads.
|
/// It will panic if it is used on multiple threads.
|
||||||
#[derive(Copy, Clone, Hash, Debug, Eq, PartialEq)]
|
#[derive(Debug)]
|
||||||
pub struct OneThread<T> {
|
pub struct OneThread<T> {
|
||||||
#[cfg(parallel_compiler)]
|
#[cfg(parallel_compiler)]
|
||||||
thread: thread::ThreadId,
|
thread: thread::ThreadId,
|
||||||
|
|
|
@ -3,7 +3,7 @@ use crate::stable_hasher::{StableHasher, HashStable};
|
||||||
/// A vector type optimized for cases where this size is usually 0 (cf. `SmallVector`).
|
/// A vector type optimized for cases where this size is usually 0 (cf. `SmallVector`).
|
||||||
/// The `Option<Box<..>>` wrapping allows us to represent a zero sized vector with `None`,
|
/// The `Option<Box<..>>` wrapping allows us to represent a zero sized vector with `None`,
|
||||||
/// which uses only a single (null) pointer.
|
/// which uses only a single (null) pointer.
|
||||||
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
|
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
|
||||||
pub struct ThinVec<T>(Option<Box<Vec<T>>>);
|
pub struct ThinVec<T>(Option<Box<Vec<T>>>);
|
||||||
|
|
||||||
impl<T> ThinVec<T> {
|
impl<T> ThinVec<T> {
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|
||||||
#[derive(Clone, Hash, Debug, PartialEq)]
|
#[derive(Clone)]
|
||||||
pub struct TinyList<T: PartialEq> {
|
pub struct TinyList<T: PartialEq> {
|
||||||
head: Option<Element<T>>
|
head: Option<Element<T>>
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ impl<T: PartialEq> TinyList<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Hash, Debug, PartialEq)]
|
#[derive(Clone)]
|
||||||
struct Element<T: PartialEq> {
|
struct Element<T: PartialEq> {
|
||||||
data: T,
|
data: T,
|
||||||
next: Option<Box<Element<T>>>,
|
next: Option<Box<Element<T>>>,
|
||||||
|
|
|
@ -11,7 +11,7 @@ use std::mem;
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct TransitiveRelation<T: Clone + Debug + Eq + Hash> {
|
pub struct TransitiveRelation<T: Eq + Hash> {
|
||||||
// List of elements. This is used to map from a T to a usize.
|
// List of elements. This is used to map from a T to a usize.
|
||||||
elements: Vec<T>,
|
elements: Vec<T>,
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ pub struct TransitiveRelation<T: Clone + Debug + Eq + Hash> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// HACK(eddyb) manual impl avoids `Default` bound on `T`.
|
// HACK(eddyb) manual impl avoids `Default` bound on `T`.
|
||||||
impl<T: Clone + Debug + Eq + Hash> Default for TransitiveRelation<T> {
|
impl<T: Eq + Hash> Default for TransitiveRelation<T> {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
TransitiveRelation {
|
TransitiveRelation {
|
||||||
elements: Default::default(),
|
elements: Default::default(),
|
||||||
|
@ -46,7 +46,7 @@ impl<T: Clone + Debug + Eq + Hash> Default for TransitiveRelation<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable, Debug)]
|
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, RustcEncodable, RustcDecodable, Debug)]
|
||||||
struct Index(usize);
|
struct Index(usize);
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Debug)]
|
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Debug)]
|
||||||
|
|
|
@ -71,7 +71,7 @@ impl Index<OutlivesConstraintIndex> for OutlivesConstraintSet {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub struct OutlivesConstraint {
|
pub struct OutlivesConstraint {
|
||||||
// NB. The ordering here is not significant for correctness, but
|
// NB. The ordering here is not significant for correctness, but
|
||||||
// it is for convenience. Before we dump the constraints in the
|
// it is for convenience. Before we dump the constraints in the
|
||||||
|
|
|
@ -129,7 +129,7 @@ rustc_index::newtype_index! {
|
||||||
|
|
||||||
/// An individual element in a region value -- the value of a
|
/// An individual element in a region value -- the value of a
|
||||||
/// particular region variable consists of a set of these elements.
|
/// particular region variable consists of a set of these elements.
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
#[derive(Debug)]
|
||||||
crate enum RegionElement {
|
crate enum RegionElement {
|
||||||
/// A point in the control-flow graph.
|
/// A point in the control-flow graph.
|
||||||
Location(Location),
|
Location(Location),
|
||||||
|
|
|
@ -146,7 +146,7 @@ struct UniversalRegionIndices<'tcx> {
|
||||||
indices: FxHashMap<ty::Region<'tcx>, RegionVid>,
|
indices: FxHashMap<ty::Region<'tcx>, RegionVid>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum RegionClassification {
|
pub enum RegionClassification {
|
||||||
/// A **global** region is one that can be named from
|
/// A **global** region is one that can be named from
|
||||||
/// anywhere. There is only one, `'static`.
|
/// anywhere. There is only one, `'static`.
|
||||||
|
|
|
@ -91,7 +91,7 @@ pub struct Frame<'mir, 'tcx, Tag=(), Extra=()> {
|
||||||
pub extra: Extra,
|
pub extra: Extra,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
|
#[derive(Clone, Eq, PartialEq)]
|
||||||
pub enum StackPopCleanup {
|
pub enum StackPopCleanup {
|
||||||
/// Jump to the next block in the caller, or cause UB if None (that's a function
|
/// Jump to the next block in the caller, or cause UB if None (that's a function
|
||||||
/// that may never return). Also store layout of return place so
|
/// that may never return). Also store layout of return place so
|
||||||
|
@ -113,7 +113,7 @@ pub struct LocalState<'tcx, Tag=(), Id=AllocId> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Current value of a local variable
|
/// Current value of a local variable
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
|
#[derive(Clone, PartialEq, Eq)]
|
||||||
pub enum LocalValue<Tag=(), Id=AllocId> {
|
pub enum LocalValue<Tag=(), Id=AllocId> {
|
||||||
/// This local is not currently alive, and cannot be used at all.
|
/// This local is not currently alive, and cannot be used at all.
|
||||||
Dead,
|
Dead,
|
||||||
|
|
|
@ -22,7 +22,7 @@ use super::{
|
||||||
Machine, AllocMap, MayLeak, ErrorHandled, CheckInAllocMsg,
|
Machine, AllocMap, MayLeak, ErrorHandled, CheckInAllocMsg,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq, Copy, Clone, Hash)]
|
#[derive(Debug, PartialEq, Copy, Clone)]
|
||||||
pub enum MemoryKind<T> {
|
pub enum MemoryKind<T> {
|
||||||
/// Error if deallocated except during a stack pop
|
/// Error if deallocated except during a stack pop
|
||||||
Stack,
|
Stack,
|
||||||
|
|
|
@ -26,7 +26,7 @@ pub use rustc::mir::interpret::ScalarMaybeUndef;
|
||||||
/// operations and fat pointers. This idea was taken from rustc's codegen.
|
/// operations and fat pointers. This idea was taken from rustc's codegen.
|
||||||
/// In particular, thanks to `ScalarPair`, arithmetic operations and casts can be entirely
|
/// In particular, thanks to `ScalarPair`, arithmetic operations and casts can be entirely
|
||||||
/// defined on `Immediate`, and do not have to work with a `Place`.
|
/// defined on `Immediate`, and do not have to work with a `Place`.
|
||||||
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
|
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
||||||
pub enum Immediate<Tag=(), Id=AllocId> {
|
pub enum Immediate<Tag=(), Id=AllocId> {
|
||||||
Scalar(ScalarMaybeUndef<Tag, Id>),
|
Scalar(ScalarMaybeUndef<Tag, Id>),
|
||||||
ScalarPair(ScalarMaybeUndef<Tag, Id>, ScalarMaybeUndef<Tag, Id>),
|
ScalarPair(ScalarMaybeUndef<Tag, Id>, ScalarMaybeUndef<Tag, Id>),
|
||||||
|
@ -123,7 +123,7 @@ impl<'tcx, Tag> ::std::ops::Deref for ImmTy<'tcx, Tag> {
|
||||||
/// An `Operand` is the result of computing a `mir::Operand`. It can be immediate,
|
/// An `Operand` is the result of computing a `mir::Operand`. It can be immediate,
|
||||||
/// or still in memory. The latter is an optimization, to delay reading that chunk of
|
/// or still in memory. The latter is an optimization, to delay reading that chunk of
|
||||||
/// memory and to avoid having to store arbitrary-sized data here.
|
/// memory and to avoid having to store arbitrary-sized data here.
|
||||||
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
|
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
||||||
pub enum Operand<Tag=(), Id=AllocId> {
|
pub enum Operand<Tag=(), Id=AllocId> {
|
||||||
Immediate(Immediate<Tag, Id>),
|
Immediate(Immediate<Tag, Id>),
|
||||||
Indirect(MemPlace<Tag, Id>),
|
Indirect(MemPlace<Tag, Id>),
|
||||||
|
@ -153,7 +153,7 @@ impl<Tag> Operand<Tag> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
|
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||||
pub struct OpTy<'tcx, Tag=()> {
|
pub struct OpTy<'tcx, Tag=()> {
|
||||||
op: Operand<Tag>, // Keep this private, it helps enforce invariants
|
op: Operand<Tag>, // Keep this private, it helps enforce invariants
|
||||||
pub layout: TyLayout<'tcx>,
|
pub layout: TyLayout<'tcx>,
|
||||||
|
|
|
@ -199,7 +199,7 @@ use rustc_data_structures::sync::{MTRef, MTLock, ParallelIterator, par_iter};
|
||||||
|
|
||||||
use std::iter;
|
use std::iter;
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Hash, Clone, Copy, Debug)]
|
#[derive(PartialEq)]
|
||||||
pub enum MonoItemCollectionMode {
|
pub enum MonoItemCollectionMode {
|
||||||
Eager,
|
Eager,
|
||||||
Lazy
|
Lazy
|
||||||
|
|
|
@ -71,8 +71,7 @@ mod riscv_base;
|
||||||
mod wasm32_base;
|
mod wasm32_base;
|
||||||
mod vxworks_base;
|
mod vxworks_base;
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Hash,
|
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
|
||||||
RustcEncodable, RustcDecodable)]
|
|
||||||
pub enum LinkerFlavor {
|
pub enum LinkerFlavor {
|
||||||
Em,
|
Em,
|
||||||
Gcc,
|
Gcc,
|
||||||
|
@ -82,8 +81,7 @@ pub enum LinkerFlavor {
|
||||||
PtxLinker,
|
PtxLinker,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Hash,
|
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
|
||||||
RustcEncodable, RustcDecodable)]
|
|
||||||
pub enum LldFlavor {
|
pub enum LldFlavor {
|
||||||
Wasm,
|
Wasm,
|
||||||
Ld64,
|
Ld64,
|
||||||
|
|
|
@ -1307,7 +1307,7 @@ impl Clean<Option<Lifetime>> for ty::RegionKind {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Hash)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum WherePredicate {
|
pub enum WherePredicate {
|
||||||
BoundPredicate { ty: Type, bounds: Vec<GenericBound> },
|
BoundPredicate { ty: Type, bounds: Vec<GenericBound> },
|
||||||
RegionPredicate { lifetime: Lifetime, bounds: Vec<GenericBound> },
|
RegionPredicate { lifetime: Lifetime, bounds: Vec<GenericBound> },
|
||||||
|
@ -1589,7 +1589,7 @@ impl Clean<GenericParamDef> for hir::GenericParam {
|
||||||
}
|
}
|
||||||
|
|
||||||
// maybe use a Generic enum and use Vec<Generic>?
|
// maybe use a Generic enum and use Vec<Generic>?
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Default, Hash)]
|
#[derive(Clone, Debug, Default)]
|
||||||
pub struct Generics {
|
pub struct Generics {
|
||||||
pub params: Vec<GenericParamDef>,
|
pub params: Vec<GenericParamDef>,
|
||||||
pub where_predicates: Vec<WherePredicate>,
|
pub where_predicates: Vec<WherePredicate>,
|
||||||
|
@ -3847,7 +3847,7 @@ impl Clean<Mutability> for hir::Mutability {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Copy, Debug, Hash)]
|
#[derive(Clone, PartialEq, Debug)]
|
||||||
pub enum ImplPolarity {
|
pub enum ImplPolarity {
|
||||||
Positive,
|
Positive,
|
||||||
Negative,
|
Negative,
|
||||||
|
@ -4506,7 +4506,6 @@ struct RegionDeps<'tcx> {
|
||||||
smaller: FxHashSet<RegionTarget<'tcx>>
|
smaller: FxHashSet<RegionTarget<'tcx>>
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Eq, PartialEq, Hash, Debug)]
|
|
||||||
enum SimpleBound {
|
enum SimpleBound {
|
||||||
TraitBound(Vec<PathSegment>, Vec<SimpleBound>, Vec<GenericParamDef>, hir::TraitBoundModifier),
|
TraitBound(Vec<PathSegment>, Vec<SimpleBound>, Vec<GenericParamDef>, hir::TraitBoundModifier),
|
||||||
Outlives(Lifetime),
|
Outlives(Lifetime),
|
||||||
|
|
|
@ -1305,7 +1305,7 @@ impl MacroDef {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, RustcEncodable, RustcDecodable, Debug, Copy, Hash, PartialEq)]
|
#[derive(Clone, RustcEncodable, RustcDecodable, Debug, Copy)]
|
||||||
pub enum StrStyle {
|
pub enum StrStyle {
|
||||||
/// A regular string, like `"foo"`.
|
/// A regular string, like `"foo"`.
|
||||||
Cooked,
|
Cooked,
|
||||||
|
@ -1327,7 +1327,7 @@ pub struct Lit {
|
||||||
pub span: Span,
|
pub span: Span,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, RustcEncodable, RustcDecodable, Debug, Copy, Hash, PartialEq)]
|
#[derive(Clone, RustcEncodable, RustcDecodable, Debug, Copy)]
|
||||||
pub enum LitIntType {
|
pub enum LitIntType {
|
||||||
Signed(IntTy),
|
Signed(IntTy),
|
||||||
Unsigned(UintTy),
|
Unsigned(UintTy),
|
||||||
|
@ -1337,7 +1337,7 @@ pub enum LitIntType {
|
||||||
/// Literal kind.
|
/// Literal kind.
|
||||||
///
|
///
|
||||||
/// E.g., `"foo"`, `42`, `12.34`, or `bool`.
|
/// E.g., `"foo"`, `42`, `12.34`, or `bool`.
|
||||||
#[derive(Clone, RustcEncodable, RustcDecodable, Debug, Hash, PartialEq)]
|
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
|
||||||
pub enum LitKind {
|
pub enum LitKind {
|
||||||
/// A string literal (`"foo"`).
|
/// A string literal (`"foo"`).
|
||||||
Str(Symbol, StrStyle),
|
Str(Symbol, StrStyle),
|
||||||
|
|
|
@ -84,7 +84,7 @@ fn handle_errors(sess: &ParseSess, span: Span, error: AttrError) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Hash, PartialEq, RustcEncodable, RustcDecodable)]
|
#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable)]
|
||||||
pub enum InlineAttr {
|
pub enum InlineAttr {
|
||||||
None,
|
None,
|
||||||
Hint,
|
Hint,
|
||||||
|
@ -92,7 +92,7 @@ pub enum InlineAttr {
|
||||||
Never,
|
Never,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Hash, PartialEq, RustcEncodable, RustcDecodable)]
|
#[derive(Clone, RustcEncodable, RustcDecodable)]
|
||||||
pub enum OptimizeAttr {
|
pub enum OptimizeAttr {
|
||||||
None,
|
None,
|
||||||
Speed,
|
Speed,
|
||||||
|
@ -624,8 +624,7 @@ pub fn eval_condition<F>(cfg: &ast::MetaItem, sess: &ParseSess, eval: &mut F)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(RustcEncodable, RustcDecodable, Clone)]
|
||||||
#[derive(RustcEncodable, RustcDecodable, PartialEq, PartialOrd, Clone, Debug, Eq, Hash)]
|
|
||||||
pub struct Deprecation {
|
pub struct Deprecation {
|
||||||
pub since: Option<Symbol>,
|
pub since: Option<Symbol>,
|
||||||
pub note: Option<Symbol>,
|
pub note: Option<Symbol>,
|
||||||
|
@ -749,7 +748,7 @@ pub enum ReprAttr {
|
||||||
ReprAlign(u32),
|
ReprAlign(u32),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Eq, Hash, PartialEq, Debug, RustcEncodable, RustcDecodable, Copy, Clone)]
|
#[derive(Eq, PartialEq, Debug, RustcEncodable, RustcDecodable, Copy, Clone)]
|
||||||
pub enum IntType {
|
pub enum IntType {
|
||||||
SignedInt(ast::IntTy),
|
SignedInt(ast::IntTy),
|
||||||
UnsignedInt(ast::UintTy)
|
UnsignedInt(ast::UintTy)
|
||||||
|
|
|
@ -35,7 +35,6 @@ use rustc_serialize::{Encodable, Decodable, Encoder, Decoder};
|
||||||
|
|
||||||
use rustc_data_structures::stable_hasher::{StableHasher, HashStable};
|
use rustc_data_structures::stable_hasher::{StableHasher, HashStable};
|
||||||
/// An owned smart pointer.
|
/// An owned smart pointer.
|
||||||
#[derive(Hash, PartialEq, Eq)]
|
|
||||||
pub struct P<T: ?Sized> {
|
pub struct P<T: ?Sized> {
|
||||||
ptr: Box<T>
|
ptr: Box<T>
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ pub fn original_sp(sp: Span, enclosing_sp: Span) -> Span {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
|
#[derive(Clone, RustcEncodable, RustcDecodable, Debug, Copy)]
|
||||||
pub struct Spanned<T> {
|
pub struct Spanned<T> {
|
||||||
pub node: T,
|
pub node: T,
|
||||||
pub span: Span,
|
pub span: Span,
|
||||||
|
|
|
@ -73,7 +73,7 @@ impl KleeneToken {
|
||||||
|
|
||||||
/// A Kleene-style [repetition operator](http://en.wikipedia.org/wiki/Kleene_star)
|
/// A Kleene-style [repetition operator](http://en.wikipedia.org/wiki/Kleene_star)
|
||||||
/// for token sequences.
|
/// for token sequences.
|
||||||
#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
|
#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Copy)]
|
||||||
enum KleeneOp {
|
enum KleeneOp {
|
||||||
/// Kleene star (`*`) for zero or more repetitions
|
/// Kleene star (`*`) for zero or more repetitions
|
||||||
ZeroOrMore,
|
ZeroOrMore,
|
||||||
|
|
|
@ -1311,7 +1311,7 @@ pub struct BytePos(pub u32);
|
||||||
/// A character offset. Because of multibyte UTF-8 characters, a byte offset
|
/// A character offset. Because of multibyte UTF-8 characters, a byte offset
|
||||||
/// is not equivalent to a character offset. The `SourceMap` will convert `BytePos`
|
/// is not equivalent to a character offset. The `SourceMap` will convert `BytePos`
|
||||||
/// values to `CharPos` values as necessary.
|
/// values to `CharPos` values as necessary.
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)]
|
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
|
||||||
pub struct CharPos(pub usize);
|
pub struct CharPos(pub usize);
|
||||||
|
|
||||||
// FIXME: lots of boilerplate in these impls, but so far my attempts to fix
|
// FIXME: lots of boilerplate in these impls, but so far my attempts to fix
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue