Skip to content

Commit 95e1a39

Browse files
BoxyUwUJulianKnodt
authored andcommitted
correctly intern List<Const<'tcx>>
1 parent 5a496aa commit 95e1a39

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/rustc_middle/src/ty/context.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ pub struct CtxtInterners<'tcx> {
137137
// Specifically use a speedy hash algorithm for these hash sets, since
138138
// they're accessed quite often.
139139
type_: InternedSet<'tcx, WithStableHash<TyS<'tcx>>>,
140+
const_lists: InternedSet<'tcx, List<ty::Const<'tcx>>>,
140141
substs: InternedSet<'tcx, InternalSubsts<'tcx>>,
141142
canonical_var_infos: InternedSet<'tcx, List<CanonicalVarInfo<'tcx>>>,
142143
region: InternedSet<'tcx, RegionKind<'tcx>>,
@@ -157,6 +158,7 @@ impl<'tcx> CtxtInterners<'tcx> {
157158
CtxtInterners {
158159
arena,
159160
type_: Default::default(),
161+
const_lists: Default::default(),
160162
substs: Default::default(),
161163
region: Default::default(),
162164
poly_existential_predicates: Default::default(),
@@ -2261,6 +2263,7 @@ macro_rules! slice_interners {
22612263
}
22622264

22632265
slice_interners!(
2266+
const_lists: _intern_const_list(Const<'tcx>),
22642267
substs: _intern_substs(GenericArg<'tcx>),
22652268
canonical_var_infos: _intern_canonical_var_infos(CanonicalVarInfo<'tcx>),
22662269
poly_existential_predicates:
@@ -2722,7 +2725,7 @@ impl<'tcx> TyCtxt<'tcx> {
27222725
}
27232726

27242727
pub fn intern_const_list(self, cs: &[ty::Const<'tcx>]) -> &'tcx List<ty::Const<'tcx>> {
2725-
if cs.is_empty() { List::empty() } else { List::from_arena(self.arena, cs) }
2728+
if cs.is_empty() { List::empty() } else { self._intern_const_list(cs) }
27262729
}
27272730

27282731
pub fn intern_type_list(self, ts: &[Ty<'tcx>]) -> &'tcx List<Ty<'tcx>> {

0 commit comments

Comments
 (0)