From 70db73a33011794622e22f10fbc0c6b2cae4292c Mon Sep 17 00:00:00 2001 From: Falco Hirschenberger Date: Mon, 18 May 2015 16:37:05 +0200 Subject: [PATCH] Show the span of feature that is unstable when using a feature-list. --- src/librustc_lint/builtin.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 8d555240e70..adce0c145b7 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -2203,7 +2203,11 @@ impl LintPass for UnstableFeatures { } fn check_attribute(&mut self, ctx: &Context, attr: &ast::Attribute) { if attr::contains_name(&[attr.node.value.clone()], "feature") { - ctx.span_lint(UNSTABLE_FEATURES, attr.span, "unstable feature"); + if let Some(items) = attr.node.value.meta_item_list() { + for item in items { + ctx.span_lint(UNSTABLE_FEATURES, item.span, "unstable feature"); + } + } } } }