Skip to content

Commit bbf29b4

Browse files
committed
Address review comments
1 parent 6e5fc90 commit bbf29b4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown_item.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ impl OnUnknownItemParser {
1717
args: &ArgParser,
1818
mode: Mode,
1919
) {
20+
if !cx.features().diagnostic_on_unknown_item() {
21+
return;
22+
}
2023
let span = cx.attr_span;
2124
self.span = Some(span);
2225

@@ -54,7 +57,7 @@ impl<S: Stage> AttributeParser<S> for OnUnknownItemParser {
5457
this.parse(cx, args, Mode::DiagnosticOnUnknownItem);
5558
},
5659
)];
57-
//FIXME attribute is not parsed for non-traits but diagnostics are issued in `check_attr.rs`
60+
//FIXME attribute is not parsed for non-use statements but diagnostics are issued in `check_attr.rs`
5861
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(ALL_TARGETS);
5962

6063
fn finalize(self, _cx: &FinalizeContext<'_, '_, S>) -> Option<AttributeKind> {

0 commit comments

Comments
 (0)