mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
Add test for duplicated doc aliases
This commit is contained in:
parent
40fe064c63
commit
013aa378f3
9
src/test/ui/duplicate_doc_alias.rs
Normal file
9
src/test/ui/duplicate_doc_alias.rs
Normal file
@ -0,0 +1,9 @@
|
||||
#![deny(unused_attributes)]
|
||||
|
||||
#[doc(alias = "A")]
|
||||
#[doc(alias = "A")] //~ ERROR
|
||||
#[doc(alias = "B")]
|
||||
#[doc(alias("B"))] //~ ERROR
|
||||
pub struct Foo;
|
||||
|
||||
fn main() {}
|
24
src/test/ui/duplicate_doc_alias.stderr
Normal file
24
src/test/ui/duplicate_doc_alias.stderr
Normal file
@ -0,0 +1,24 @@
|
||||
error: doc alias is duplicated
|
||||
--> $DIR/duplicate_doc_alias.rs:4:7
|
||||
|
|
||||
LL | #[doc(alias = "A")]
|
||||
| ----------- first defined here
|
||||
LL | #[doc(alias = "A")]
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/duplicate_doc_alias.rs:1:9
|
||||
|
|
||||
LL | #![deny(unused_attributes)]
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: doc alias is duplicated
|
||||
--> $DIR/duplicate_doc_alias.rs:6:13
|
||||
|
|
||||
LL | #[doc(alias = "B")]
|
||||
| ----------- first defined here
|
||||
LL | #[doc(alias("B"))]
|
||||
| ^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
Loading…
Reference in New Issue
Block a user