Encode proc macro stability
This commit is contained in:
parent
e501a87e89
commit
70156fbb75
|
@ -648,7 +648,7 @@ impl<'a, 'tcx> CrateMetadata {
|
|||
|
||||
pub fn get_stability(&self, id: DefIndex) -> Option<attr::Stability> {
|
||||
match self.is_proc_macro(id) {
|
||||
true => None,
|
||||
true => self.root.proc_macro_stability.clone(),
|
||||
false => self.entry(id).stability.map(|stab| stab.decode(self)),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -490,7 +490,11 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
|
|||
} else {
|
||||
None
|
||||
},
|
||||
|
||||
proc_macro_stability: if is_proc_macro {
|
||||
tcx.lookup_stability(DefId::local(CRATE_DEF_INDEX)).map(|stab| stab.clone())
|
||||
} else {
|
||||
None
|
||||
},
|
||||
compiler_builtins: attr::contains_name(&attrs, "compiler_builtins"),
|
||||
needs_allocator: attr::contains_name(&attrs, "needs_allocator"),
|
||||
needs_panic_runtime: attr::contains_name(&attrs, "needs_panic_runtime"),
|
||||
|
|
|
@ -187,6 +187,7 @@ pub struct CrateRoot {
|
|||
pub has_default_lib_allocator: bool,
|
||||
pub plugin_registrar_fn: Option<DefIndex>,
|
||||
pub proc_macro_decls_static: Option<DefIndex>,
|
||||
pub proc_macro_stability: Option<attr::Stability>,
|
||||
|
||||
pub crate_deps: LazySeq<CrateDep>,
|
||||
pub dylib_dependency_formats: LazySeq<Option<LinkagePreference>>,
|
||||
|
|
Loading…
Reference in New Issue