From e399091785fab06cb1e9644c28a47dc2f6966c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Thu, 27 Nov 2025 16:01:42 +0100 Subject: [PATCH] remove session+blob decoder construction --- compiler/rustc_metadata/src/creader.rs | 1 - compiler/rustc_metadata/src/rmeta/decoder.rs | 16 +--------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/compiler/rustc_metadata/src/creader.rs b/compiler/rustc_metadata/src/creader.rs index 4e2e1e21ec6dd..95862ce01687d 100644 --- a/compiler/rustc_metadata/src/creader.rs +++ b/compiler/rustc_metadata/src/creader.rs @@ -683,7 +683,6 @@ impl CStore { }; let crate_metadata = CrateMetadata::new( - tcx.sess, self, metadata, crate_root, diff --git a/compiler/rustc_metadata/src/rmeta/decoder.rs b/compiler/rustc_metadata/src/rmeta/decoder.rs index 6c796b3a9c8c5..e997ae8a3989f 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder.rs @@ -211,19 +211,6 @@ impl<'a, 'tcx> Metadata<'a, 'tcx> for &'a MetadataBlob { } } -impl<'a, 'tcx> Metadata<'a, 'tcx> for (&'a MetadataBlob, &'tcx Session) { - #[inline] - fn blob(self) -> &'a MetadataBlob { - self.0 - } - - #[inline] - fn sess(self) -> Option<&'tcx Session> { - let (_, sess) = self; - Some(sess) - } -} - impl<'a, 'tcx> Metadata<'a, 'tcx> for CrateMetadataRef<'a> { #[inline] fn blob(self) -> &'a MetadataBlob { @@ -1862,7 +1849,6 @@ impl<'a> CrateMetadataRef<'a> { impl CrateMetadata { pub(crate) fn new( - sess: &Session, cstore: &CStore, blob: MetadataBlob, root: CrateRoot, @@ -1876,7 +1862,7 @@ impl CrateMetadata { ) -> CrateMetadata { let trait_impls = root .impls - .decode((&blob, sess)) + .decode(&blob) .map(|trait_impls| (trait_impls.trait_id, trait_impls.impls)) .collect(); let alloc_decoding_state =