Add Attribute::meta_kind
This commit is contained in:
parent
f8abed9ed4
commit
047275a682
4 changed files with 32 additions and 11 deletions
|
@ -4,7 +4,7 @@
|
|||
// and `#[unstable (..)]`), but are not declared in one single location
|
||||
// (unlike lang features), which means we need to collect them instead.
|
||||
|
||||
use rustc_ast::{Attribute, MetaItem, MetaItemKind};
|
||||
use rustc_ast::{Attribute, MetaItemKind};
|
||||
use rustc_errors::struct_span_err;
|
||||
use rustc_hir::intravisit::{NestedVisitorMap, Visitor};
|
||||
use rustc_middle::hir::map::Map;
|
||||
|
@ -34,8 +34,8 @@ impl<'tcx> LibFeatureCollector<'tcx> {
|
|||
// Find a stability attribute (i.e., `#[stable (..)]`, `#[unstable (..)]`,
|
||||
// `#[rustc_const_unstable (..)]`).
|
||||
if let Some(stab_attr) = stab_attrs.iter().find(|stab_attr| attr.has_name(**stab_attr)) {
|
||||
let meta_item = attr.meta();
|
||||
if let Some(MetaItem { kind: MetaItemKind::List(ref metas), .. }) = meta_item {
|
||||
let meta_kind = attr.meta_kind();
|
||||
if let Some(MetaItemKind::List(ref metas)) = meta_kind {
|
||||
let mut feature = None;
|
||||
let mut since = None;
|
||||
for meta in metas {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue