Skip to content

Commit 013aa37

Browse files
Add test for duplicated doc aliases
1 parent 40fe064 commit 013aa37

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

src/test/ui/duplicate_doc_alias.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![deny(unused_attributes)]
2+
3+
#[doc(alias = "A")]
4+
#[doc(alias = "A")] //~ ERROR
5+
#[doc(alias = "B")]
6+
#[doc(alias("B"))] //~ ERROR
7+
pub struct Foo;
8+
9+
fn main() {}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
error: doc alias is duplicated
2+
--> $DIR/duplicate_doc_alias.rs:4:7
3+
|
4+
LL | #[doc(alias = "A")]
5+
| ----------- first defined here
6+
LL | #[doc(alias = "A")]
7+
| ^^^^^^^^^^^
8+
|
9+
note: the lint level is defined here
10+
--> $DIR/duplicate_doc_alias.rs:1:9
11+
|
12+
LL | #![deny(unused_attributes)]
13+
| ^^^^^^^^^^^^^^^^^
14+
15+
error: doc alias is duplicated
16+
--> $DIR/duplicate_doc_alias.rs:6:13
17+
|
18+
LL | #[doc(alias = "B")]
19+
| ----------- first defined here
20+
LL | #[doc(alias("B"))]
21+
| ^^^
22+
23+
error: aborting due to 2 previous errors
24+

0 commit comments

Comments
 (0)