Add ui test for unsupported doc(attribute = "...") case for attributes with namespace
This commit is contained in:
@@ -879,6 +879,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
|
||||
s.is_reserved(|| edition::LATEST_STABLE_EDITION) || s.is_weak() || s == sym::SelfTy
|
||||
}
|
||||
|
||||
// FIXME: This should support attributes with namespace like `diagnostic::do_not_recommend`.
|
||||
fn is_builtin_attr(s: Symbol) -> bool {
|
||||
rustc_feature::BUILTIN_ATTRIBUTE_MAP.contains_key(&s)
|
||||
}
|
||||
|
||||
7
tests/rustdoc-ui/doc-attribute-unsupported.rs
Normal file
7
tests/rustdoc-ui/doc-attribute-unsupported.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
// This is currently not supported but should be!
|
||||
|
||||
#![feature(rustdoc_internals)]
|
||||
|
||||
#[doc(attribute = "diagnostic::do_not_recommend")] //~ ERROR
|
||||
/// bla
|
||||
mod yup {}
|
||||
10
tests/rustdoc-ui/doc-attribute-unsupported.stderr
Normal file
10
tests/rustdoc-ui/doc-attribute-unsupported.stderr
Normal file
@@ -0,0 +1,10 @@
|
||||
error: nonexistent builtin attribute `diagnostic::do_not_recommend` used in `#[doc(attribute = "...")]`
|
||||
--> $DIR/doc-attribute-unsupported.rs:5:19
|
||||
|
|
||||
LL | #[doc(attribute = "diagnostic::do_not_recommend")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: only existing builtin attributes are allowed in core/std
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
Reference in New Issue
Block a user