diff options
| author | Jonas Schievink <jonasschievink@gmail.com> | 2020-10-24 22:39:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-24 22:39:59 +0200 |
| commit | a8ff5a4e03a4f0fc7cb87bc3fdb4a1e0144e6e73 (patch) | |
| tree | 39933b4c398339c5f457463486eafbcf1cedaeb7 | |
| parent | 5ed8ac45d493698c0715ba02a90d7310298a9da0 (diff) | |
| parent | 6533d010cfe931f5f39f299b94eb4768855fe712 (diff) | |
| download | rust-a8ff5a4e03a4f0fc7cb87bc3fdb4a1e0144e6e73.tar.gz rust-a8ff5a4e03a4f0fc7cb87bc3fdb4a1e0144e6e73.zip | |
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.
| -rw-r--r-- | compiler/rustc_middle/src/ty/context.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index ab92e5b745b..f6ea6743a0e 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -2036,13 +2036,13 @@ direct_interners! { 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 - } - })+ + })+ + } ); } |
