Skip to content

Commit f3218b2

Browse files
Make ConstKind and TyKind Copy
1 parent e947234 commit f3218b2

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

compiler/rustc_middle/src/arena.rs

-4
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ macro_rules! arena_types {
9292
[] name_set: rustc_data_structures::unord::UnordSet<rustc_span::symbol::Symbol>,
9393
[] ordered_name_set: rustc_data_structures::fx::FxIndexSet<rustc_span::symbol::Symbol>,
9494

95-
// Interned types
96-
[] tys: rustc_type_ir::WithCachedTypeInfo<rustc_middle::ty::TyKind<'tcx>>,
97-
[] consts: rustc_type_ir::WithCachedTypeInfo<rustc_middle::ty::ConstData<'tcx>>,
98-
9995
// Note that this deliberately duplicates items in the `rustc_hir::arena`,
10096
// since we need to allocate this type on both the `rustc_hir` arena
10197
// (during lowering) and the `librustc_middle` arena (for decoding MIR)

compiler/rustc_middle/src/ty/consts.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ impl<'tcx> ConstTy<TyCtxt<'tcx>> for Const<'tcx> {
4141
}
4242

4343
/// Typed constant value.
44-
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, HashStable, TyEncodable, TyDecodable)]
44+
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
45+
#[derive(HashStable, TyEncodable, TyDecodable)]
4546
pub struct ConstData<'tcx> {
4647
pub ty: Ty<'tcx>,
4748
pub kind: ConstKind<'tcx>,

compiler/rustc_type_ir/src/const_kind.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use self::ConstKind::*;
1010
#[derive(derivative::Derivative)]
1111
#[derivative(
1212
Clone(bound = ""),
13+
Copy(bound = ""),
1314
PartialOrd(bound = ""),
1415
PartialOrd = "feature_allow_slow_enum",
1516
Ord(bound = ""),

compiler/rustc_type_ir/src/ty_kind.rs

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ pub enum AliasKind {
111111
#[derive(derivative::Derivative)]
112112
#[derivative(
113113
Clone(bound = ""),
114+
Copy(bound = ""),
114115
PartialOrd(bound = ""),
115116
PartialOrd = "feature_allow_slow_enum",
116117
Ord(bound = ""),

0 commit comments

Comments
 (0)