Rollup merge of #78318 - bugadani:tyctx-impl, r=petrochenkov
TyCtxt: generate single impl block with `slice_interners` macro Reduces the work needed to check overlapping impls a bit.
This commit is contained in:
commit
a8ff5a4e03
@ -2036,13 +2036,13 @@ pub fn $method(self, v: $ty) -> &'tcx $ty {
|
||||
|
||||
macro_rules! slice_interners {
|
||||
($($field:ident: $method:ident($ty:ty)),+ $(,)?) => (
|
||||
$(impl<'tcx> TyCtxt<'tcx> {
|
||||
pub fn $method(self, v: &[$ty]) -> &'tcx List<$ty> {
|
||||
impl<'tcx> TyCtxt<'tcx> {
|
||||
$(pub fn $method(self, v: &[$ty]) -> &'tcx List<$ty> {
|
||||
self.interners.$field.intern_ref(v, || {
|
||||
Interned(List::from_arena(&*self.arena, v))
|
||||
}).0
|
||||
}
|
||||
})+
|
||||
})+
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user