From f13adc5f9d50f66b3b86589c35e49c92af807f23 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Wed, 2 Oct 2019 02:47:36 +0300 Subject: [PATCH] metadata: Remove `CrateMetadata::host_lib` It was only used for retreiving edition, which was a bug. In case of dual proc macros the edition should be taken from the target crate version, like any other metadata. --- src/librustc_metadata/creader.rs | 1 - src/librustc_metadata/cstore.rs | 2 -- src/librustc_metadata/decoder.rs | 7 +------ 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs index ea1b746dc07..f2980941082 100644 --- a/src/librustc_metadata/creader.rs +++ b/src/librustc_metadata/creader.rs @@ -271,7 +271,6 @@ impl<'a> CrateLoader<'a> { }, private_dep, span, - host_lib, raw_proc_macros }; diff --git a/src/librustc_metadata/cstore.rs b/src/librustc_metadata/cstore.rs index ed43aad38be..d8bbe23b8ec 100644 --- a/src/librustc_metadata/cstore.rs +++ b/src/librustc_metadata/cstore.rs @@ -28,7 +28,6 @@ pub use crate::cstore_impl::{provide, provide_extern}; pub type CrateNumMap = IndexVec; pub use rustc_data_structures::sync::MetadataRef; -use crate::creader::Library; use syntax_pos::Span; use proc_macro::bridge::client::ProcMacro; @@ -85,7 +84,6 @@ pub struct CrateMetadata { /// for purposes of the 'exported_private_dependencies' lint pub private_dep: bool, - pub host_lib: Option, pub span: Span, pub raw_proc_macros: Option<&'static [ProcMacro]>, diff --git a/src/librustc_metadata/decoder.rs b/src/librustc_metadata/decoder.rs index 9fcc3101545..6681cf3052f 100644 --- a/src/librustc_metadata/decoder.rs +++ b/src/librustc_metadata/decoder.rs @@ -543,18 +543,13 @@ impl<'a, 'tcx> CrateMetadata { name, SyntaxExtensionKind::Bang(Box::new(BangProcMacro { client })), Vec::new() ) }; - let edition = if sess.opts.debugging_opts.dual_proc_macros { - self.host_lib.as_ref().unwrap().metadata.get_root().edition - } else { - self.root.edition - }; SyntaxExtension::new( &sess.parse_sess, kind, self.get_span(id, sess), helper_attrs, - edition, + self.root.edition, Symbol::intern(name), &self.get_attributes(&self.entry(id), sess), )