From 95e1a39c048b922754b3bc0fc5d305259a56289f Mon Sep 17 00:00:00 2001 From: Boxy Date: Wed, 23 Nov 2022 09:25:01 +0000 Subject: [PATCH] correctly intern `List>` --- compiler/rustc_middle/src/ty/context.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index f627dc7ceb1..8cf33a5ca0b 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -137,6 +137,7 @@ pub struct CtxtInterners<'tcx> { // Specifically use a speedy hash algorithm for these hash sets, since // they're accessed quite often. type_: InternedSet<'tcx, WithStableHash>>, + const_lists: InternedSet<'tcx, List>>, substs: InternedSet<'tcx, InternalSubsts<'tcx>>, canonical_var_infos: InternedSet<'tcx, List>>, region: InternedSet<'tcx, RegionKind<'tcx>>, @@ -157,6 +158,7 @@ impl<'tcx> CtxtInterners<'tcx> { CtxtInterners { arena, type_: Default::default(), + const_lists: Default::default(), substs: Default::default(), region: Default::default(), poly_existential_predicates: Default::default(), @@ -2261,6 +2263,7 @@ macro_rules! slice_interners { } slice_interners!( + const_lists: _intern_const_list(Const<'tcx>), substs: _intern_substs(GenericArg<'tcx>), canonical_var_infos: _intern_canonical_var_infos(CanonicalVarInfo<'tcx>), poly_existential_predicates: @@ -2722,7 +2725,7 @@ impl<'tcx> TyCtxt<'tcx> { } pub fn intern_const_list(self, cs: &[ty::Const<'tcx>]) -> &'tcx List> { - if cs.is_empty() { List::empty() } else { List::from_arena(self.arena, cs) } + if cs.is_empty() { List::empty() } else { self._intern_const_list(cs) } } pub fn intern_type_list(self, ts: &[Ty<'tcx>]) -> &'tcx List> {