Skip to content

Commit fd038b5

Browse files
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.
2 parents e13f2fb + 6533d01 commit fd038b5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/rustc_middle/src/ty/context.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2036,13 +2036,13 @@ direct_interners! {
20362036

20372037
macro_rules! slice_interners {
20382038
($($field:ident: $method:ident($ty:ty)),+ $(,)?) => (
2039-
$(impl<'tcx> TyCtxt<'tcx> {
2040-
pub fn $method(self, v: &[$ty]) -> &'tcx List<$ty> {
2039+
impl<'tcx> TyCtxt<'tcx> {
2040+
$(pub fn $method(self, v: &[$ty]) -> &'tcx List<$ty> {
20412041
self.interners.$field.intern_ref(v, || {
20422042
Interned(List::from_arena(&*self.arena, v))
20432043
}).0
2044-
}
2045-
})+
2044+
})+
2045+
}
20462046
);
20472047
}
20482048

0 commit comments

Comments
 (0)