Skip to content

Commit f13adc5

Browse files
committed
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.
1 parent 92386a7 commit f13adc5

File tree

3 files changed

+1
-9
lines changed

3 files changed

+1
-9
lines changed

src/librustc_metadata/creader.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ impl<'a> CrateLoader<'a> {
271271
},
272272
private_dep,
273273
span,
274-
host_lib,
275274
raw_proc_macros
276275
};
277276

src/librustc_metadata/cstore.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ pub use crate::cstore_impl::{provide, provide_extern};
2828
pub type CrateNumMap = IndexVec<CrateNum, CrateNum>;
2929

3030
pub use rustc_data_structures::sync::MetadataRef;
31-
use crate::creader::Library;
3231
use syntax_pos::Span;
3332
use proc_macro::bridge::client::ProcMacro;
3433

@@ -85,7 +84,6 @@ pub struct CrateMetadata {
8584
/// for purposes of the 'exported_private_dependencies' lint
8685
pub private_dep: bool,
8786

88-
pub host_lib: Option<Library>,
8987
pub span: Span,
9088

9189
pub raw_proc_macros: Option<&'static [ProcMacro]>,

src/librustc_metadata/decoder.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -543,18 +543,13 @@ impl<'a, 'tcx> CrateMetadata {
543543
name, SyntaxExtensionKind::Bang(Box::new(BangProcMacro { client })), Vec::new()
544544
)
545545
};
546-
let edition = if sess.opts.debugging_opts.dual_proc_macros {
547-
self.host_lib.as_ref().unwrap().metadata.get_root().edition
548-
} else {
549-
self.root.edition
550-
};
551546

552547
SyntaxExtension::new(
553548
&sess.parse_sess,
554549
kind,
555550
self.get_span(id, sess),
556551
helper_attrs,
557-
edition,
552+
self.root.edition,
558553
Symbol::intern(name),
559554
&self.get_attributes(&self.entry(id), sess),
560555
)

0 commit comments

Comments
 (0)