Skip to content

Commit f6de130

Browse files
Add tests for doc attribute check
1 parent b0b330f commit f6de130

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

src/test/rustdoc-ui/doc-attr.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#![crate_type = "lib"]
2+
#![doc(as_ptr)] //~ ERROR
3+
4+
#[doc(as_ptr)] //~ ERROR
5+
pub fn foo() {}

src/test/rustdoc-ui/doc-attr.stderr

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: unknown `doc` attribute `as_ptr`
2+
--> $DIR/doc-attr.rs:4:7
3+
|
4+
LL | #[doc(as_ptr)]
5+
| ^^^^^^
6+
7+
error: unknown `doc` attribute `as_ptr`
8+
--> $DIR/doc-attr.rs:2:8
9+
|
10+
LL | #![doc(as_ptr)]
11+
| ^^^^^^
12+
13+
error: aborting due to 2 previous errors
14+

src/test/ui/attributes/doc-attr.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#![crate_type = "lib"]
2+
#![doc(as_ptr)] //~ ERROR
3+
4+
#[doc(as_ptr)] //~ ERROR
5+
pub fn foo() {}
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: unknown `doc` attribute `as_ptr`
2+
--> $DIR/doc-attr.rs:4:7
3+
|
4+
LL | #[doc(as_ptr)]
5+
| ^^^^^^
6+
7+
error: unknown `doc` attribute `as_ptr`
8+
--> $DIR/doc-attr.rs:2:8
9+
|
10+
LL | #![doc(as_ptr)]
11+
| ^^^^^^
12+
13+
error: aborting due to 2 previous errors
14+

0 commit comments

Comments
 (0)