Skip over rust diagnostic attributes
diff --git a/syntax/attrs.rs b/syntax/attrs.rs
index 8740d3d..9ad3d51 100644
--- a/syntax/attrs.rs
+++ b/syntax/attrs.rs
@@ -101,6 +101,13 @@
}
Err(err) => return cx.push(err),
}
+ } else if attr.path.is_ident("allow")
+ || attr.path.is_ident("warn")
+ || attr.path.is_ident("deny")
+ || attr.path.is_ident("forbid")
+ {
+ // https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes
+ continue;
}
return cx.error(attr, "unsupported attribute");
}
diff --git a/tests/ui/deny_missing_docs.stderr b/tests/ui/deny_missing_docs.stderr
index 40d9a07..a5390b1 100644
--- a/tests/ui/deny_missing_docs.stderr
+++ b/tests/ui/deny_missing_docs.stderr
@@ -1,5 +1,61 @@
-error: unsupported attribute
- --> $DIR/deny_missing_docs.rs:60:5
+error: missing documentation for a struct
+ --> $DIR/deny_missing_docs.rs:11:5
|
-60 | #[allow(missing_docs)]
- | ^^^^^^^^^^^^^^^^^^^^^^
+11 | pub struct UndocumentedStruct {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/deny_missing_docs.rs:6:9
+ |
+6 | #![deny(missing_docs)]
+ | ^^^^^^^^^^^^
+
+error: missing documentation for a struct field
+ --> $DIR/deny_missing_docs.rs:12:9
+ |
+12 | pub undocumented_field: u8,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: missing documentation for a struct
+ --> $DIR/deny_missing_docs.rs:9:1
+ |
+9 | #[cxx::bridge]
+ | ^^^^^^^^^^^^^^
+ |
+ = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: missing documentation for an associated constant
+ --> $DIR/deny_missing_docs.rs:9:1
+ |
+9 | #[cxx::bridge]
+ | ^^^^^^^^^^^^^^
+ |
+ = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: missing documentation for a type alias
+ --> $DIR/deny_missing_docs.rs:9:1
+ |
+9 | #[cxx::bridge]
+ | ^^^^^^^^^^^^^^
+ |
+ = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: missing documentation for a function
+ --> $DIR/deny_missing_docs.rs:9:1
+ |
+9 | #[cxx::bridge]
+ | ^^^^^^^^^^^^^^
+ |
+ = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: missing documentation for a struct
+ --> $DIR/deny_missing_docs.rs:61:5
+ |
+61 | pub struct SuppressUndocumentedStruct {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: missing documentation for a struct field
+ --> $DIR/deny_missing_docs.rs:62:9
+ |
+62 | pub undocumented_field: u8,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^