1
Fork 0

Add Attribute::meta_kind

This commit is contained in:
Jakub Beránek 2021-12-26 16:47:08 +01:00
parent f8abed9ed4
commit 047275a682
No known key found for this signature in database
GPG key ID: DBC553E540C2F619
4 changed files with 32 additions and 11 deletions

View file

@ -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 {