Skip to content

Commit

Permalink
Add tests for new doc alias check
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jan 4, 2021
1 parent c4c010f commit 9714ac0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/test/rustdoc-ui/doc-alias-same-name.rs
@@ -0,0 +1,4 @@
#![crate_type = "lib"]

#[doc(alias = "Foo")] //~ ERROR
pub struct Foo;
8 changes: 8 additions & 0 deletions src/test/rustdoc-ui/doc-alias-same-name.stderr
@@ -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

4 changes: 4 additions & 0 deletions src/test/ui/doc-alias-same-name.rs
@@ -0,0 +1,4 @@
#![crate_type = "lib"]

#[doc(alias = "Foo")] //~ ERROR
pub struct Foo;
8 changes: 8 additions & 0 deletions src/test/ui/doc-alias-same-name.stderr
@@ -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

0 comments on commit 9714ac0

Please sign in to comment.