Skip to content

Commit 70db73a

Browse files
Show the span of feature that is unstable when using a feature-list.
1 parent 84b1e08 commit 70db73a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustc_lint/builtin.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -2203,7 +2203,11 @@ impl LintPass for UnstableFeatures {
22032203
}
22042204
fn check_attribute(&mut self, ctx: &Context, attr: &ast::Attribute) {
22052205
if attr::contains_name(&[attr.node.value.clone()], "feature") {
2206-
ctx.span_lint(UNSTABLE_FEATURES, attr.span, "unstable feature");
2206+
if let Some(items) = attr.node.value.meta_item_list() {
2207+
for item in items {
2208+
ctx.span_lint(UNSTABLE_FEATURES, item.span, "unstable feature");
2209+
}
2210+
}
22072211
}
22082212
}
22092213
}

0 commit comments

Comments
 (0)