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.
This commit is contained in:
parent
92386a7ff3
commit
f13adc5f9d
3 changed files with 1 additions and 9 deletions
|
@ -271,7 +271,6 @@ impl<'a> CrateLoader<'a> {
|
||||||
},
|
},
|
||||||
private_dep,
|
private_dep,
|
||||||
span,
|
span,
|
||||||
host_lib,
|
|
||||||
raw_proc_macros
|
raw_proc_macros
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,6 @@ pub use crate::cstore_impl::{provide, provide_extern};
|
||||||
pub type CrateNumMap = IndexVec<CrateNum, CrateNum>;
|
pub type CrateNumMap = IndexVec<CrateNum, CrateNum>;
|
||||||
|
|
||||||
pub use rustc_data_structures::sync::MetadataRef;
|
pub use rustc_data_structures::sync::MetadataRef;
|
||||||
use crate::creader::Library;
|
|
||||||
use syntax_pos::Span;
|
use syntax_pos::Span;
|
||||||
use proc_macro::bridge::client::ProcMacro;
|
use proc_macro::bridge::client::ProcMacro;
|
||||||
|
|
||||||
|
@ -85,7 +84,6 @@ pub struct CrateMetadata {
|
||||||
/// for purposes of the 'exported_private_dependencies' lint
|
/// for purposes of the 'exported_private_dependencies' lint
|
||||||
pub private_dep: bool,
|
pub private_dep: bool,
|
||||||
|
|
||||||
pub host_lib: Option<Library>,
|
|
||||||
pub span: Span,
|
pub span: Span,
|
||||||
|
|
||||||
pub raw_proc_macros: Option<&'static [ProcMacro]>,
|
pub raw_proc_macros: Option<&'static [ProcMacro]>,
|
||||||
|
|
|
@ -543,18 +543,13 @@ impl<'a, 'tcx> CrateMetadata {
|
||||||
name, SyntaxExtensionKind::Bang(Box::new(BangProcMacro { client })), Vec::new()
|
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(
|
SyntaxExtension::new(
|
||||||
&sess.parse_sess,
|
&sess.parse_sess,
|
||||||
kind,
|
kind,
|
||||||
self.get_span(id, sess),
|
self.get_span(id, sess),
|
||||||
helper_attrs,
|
helper_attrs,
|
||||||
edition,
|
self.root.edition,
|
||||||
Symbol::intern(name),
|
Symbol::intern(name),
|
||||||
&self.get_attributes(&self.entry(id), sess),
|
&self.get_attributes(&self.entry(id), sess),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue