Skip to content

Commit

Permalink
Add tests for doc attribute check
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Mar 1, 2021
1 parent b0b330f commit f6de130
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/rustdoc-ui/doc-attr.rs
@@ -0,0 +1,5 @@
#![crate_type = "lib"]
#![doc(as_ptr)] //~ ERROR

#[doc(as_ptr)] //~ ERROR
pub fn foo() {}
14 changes: 14 additions & 0 deletions src/test/rustdoc-ui/doc-attr.stderr
@@ -0,0 +1,14 @@
error: unknown `doc` attribute `as_ptr`
--> $DIR/doc-attr.rs:4:7
|
LL | #[doc(as_ptr)]
| ^^^^^^

error: unknown `doc` attribute `as_ptr`
--> $DIR/doc-attr.rs:2:8
|
LL | #![doc(as_ptr)]
| ^^^^^^

error: aborting due to 2 previous errors

5 changes: 5 additions & 0 deletions src/test/ui/attributes/doc-attr.rs
@@ -0,0 +1,5 @@
#![crate_type = "lib"]
#![doc(as_ptr)] //~ ERROR

#[doc(as_ptr)] //~ ERROR
pub fn foo() {}
14 changes: 14 additions & 0 deletions src/test/ui/attributes/doc-attr.stderr
@@ -0,0 +1,14 @@
error: unknown `doc` attribute `as_ptr`
--> $DIR/doc-attr.rs:4:7
|
LL | #[doc(as_ptr)]
| ^^^^^^

error: unknown `doc` attribute `as_ptr`
--> $DIR/doc-attr.rs:2:8
|
LL | #![doc(as_ptr)]
| ^^^^^^

error: aborting due to 2 previous errors

0 comments on commit f6de130

Please sign in to comment.