Skip to content

Commit 2d6267a

Browse files
Add test for doc alias attribute validation
1 parent b97487b commit 2d6267a

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![feature(doc_alias)]
2+
3+
#[doc(alias = "foo")] // ok!
4+
pub struct Bar;
5+
6+
#[doc(alias)] //~ ERROR
7+
#[doc(alias = 0)] //~ ERROR
8+
#[doc(alias("bar"))] //~ ERROR
9+
pub struct Foo;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error: doc alias attribute expects a string: #[doc(alias = "0")]
2+
--> $DIR/check-doc-alias-attr.rs:6:7
3+
|
4+
LL | #[doc(alias)]
5+
| ^^^^^
6+
7+
error: doc alias attribute expects a string: #[doc(alias = "0")]
8+
--> $DIR/check-doc-alias-attr.rs:7:7
9+
|
10+
LL | #[doc(alias = 0)]
11+
| ^^^^^^^^^
12+
13+
error: doc alias attribute expects a string: #[doc(alias = "0")]
14+
--> $DIR/check-doc-alias-attr.rs:8:7
15+
|
16+
LL | #[doc(alias("bar"))]
17+
| ^^^^^^^^^^^^
18+
19+
error: aborting due to 3 previous errors
20+

0 commit comments

Comments
 (0)