mirror of https://github.com/rust-lang/rust.git
Make ConstKind and TyKind Copy
This commit is contained in:
parent
e947234520
commit
f3218b2a70
|
@ -92,10 +92,6 @@ macro_rules! arena_types {
|
|||
[] name_set: rustc_data_structures::unord::UnordSet<rustc_span::symbol::Symbol>,
|
||||
[] ordered_name_set: rustc_data_structures::fx::FxIndexSet<rustc_span::symbol::Symbol>,
|
||||
|
||||
// Interned types
|
||||
[] tys: rustc_type_ir::WithCachedTypeInfo<rustc_middle::ty::TyKind<'tcx>>,
|
||||
[] consts: rustc_type_ir::WithCachedTypeInfo<rustc_middle::ty::ConstData<'tcx>>,
|
||||
|
||||
// Note that this deliberately duplicates items in the `rustc_hir::arena`,
|
||||
// since we need to allocate this type on both the `rustc_hir` arena
|
||||
// (during lowering) and the `librustc_middle` arena (for decoding MIR)
|
||||
|
|
|
@ -41,7 +41,8 @@ impl<'tcx> ConstTy<TyCtxt<'tcx>> for Const<'tcx> {
|
|||
}
|
||||
|
||||
/// Typed constant value.
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, HashStable, TyEncodable, TyDecodable)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[derive(HashStable, TyEncodable, TyDecodable)]
|
||||
pub struct ConstData<'tcx> {
|
||||
pub ty: Ty<'tcx>,
|
||||
pub kind: ConstKind<'tcx>,
|
||||
|
|
|
@ -10,6 +10,7 @@ use self::ConstKind::*;
|
|||
#[derive(derivative::Derivative)]
|
||||
#[derivative(
|
||||
Clone(bound = ""),
|
||||
Copy(bound = ""),
|
||||
PartialOrd(bound = ""),
|
||||
PartialOrd = "feature_allow_slow_enum",
|
||||
Ord(bound = ""),
|
||||
|
|
|
@ -111,6 +111,7 @@ pub enum AliasKind {
|
|||
#[derive(derivative::Derivative)]
|
||||
#[derivative(
|
||||
Clone(bound = ""),
|
||||
Copy(bound = ""),
|
||||
PartialOrd(bound = ""),
|
||||
PartialOrd = "feature_allow_slow_enum",
|
||||
Ord(bound = ""),
|
||||
|
|
Loading…
Reference in New Issue