diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-01-04 15:05:49 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-01-04 16:30:53 +0100 |
| commit | 9714ac08a5476ccfbbce859d3fb69905a64668e1 (patch) | |
| tree | ceaba421de4b0d7f46aa3d32f25517cb3d8b62ab /src/test/rustdoc-ui | |
| parent | c4c010f5348f215adf98f4ca0ae66c4f999943dd (diff) | |
| download | rust-9714ac08a5476ccfbbce859d3fb69905a64668e1.tar.gz rust-9714ac08a5476ccfbbce859d3fb69905a64668e1.zip | |
Add tests for new doc alias check
Diffstat (limited to 'src/test/rustdoc-ui')
| -rw-r--r-- | src/test/rustdoc-ui/doc-alias-same-name.rs | 4 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/doc-alias-same-name.stderr | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/doc-alias-same-name.rs b/src/test/rustdoc-ui/doc-alias-same-name.rs new file mode 100644 index 00000000000..da97c267618 --- /dev/null +++ b/src/test/rustdoc-ui/doc-alias-same-name.rs @@ -0,0 +1,4 @@ +#![crate_type = "lib"] + +#[doc(alias = "Foo")] //~ ERROR +pub struct Foo; diff --git a/src/test/rustdoc-ui/doc-alias-same-name.stderr b/src/test/rustdoc-ui/doc-alias-same-name.stderr new file mode 100644 index 00000000000..5ba09a2eae1 --- /dev/null +++ b/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 + |
