Add tests for new doc alias check

This commit is contained in:
Guillaume Gomez 2021-01-04 15:05:49 +01:00
parent c4c010f534
commit 9714ac08a5
4 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,4 @@
#![crate_type = "lib"]
#[doc(alias = "Foo")] //~ ERROR
pub struct Foo;

View file

@ -0,0 +1,8 @@
error: `#[doc(alias = "...")]` is the same as the item's name
--> $DIR/doc-alias-same-name.rs:3:7
|
LL | #[doc(alias = "Foo")]
| ^^^^^^^^^^^^^
error: aborting due to previous error

View file

@ -0,0 +1,4 @@
#![crate_type = "lib"]
#[doc(alias = "Foo")] //~ ERROR
pub struct Foo;

View file

@ -0,0 +1,8 @@
error: `#[doc(alias = "...")]` is the same as the item's name
--> $DIR/doc-alias-same-name.rs:3:7
|
LL | #[doc(alias = "Foo")]
| ^^^^^^^^^^^^^
error: aborting due to previous error