diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-07-06 16:11:32 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-08-11 23:21:05 +0200 |
| commit | 23a2ba6e53cd5cd8c4cc2f75cc1e7d2ac20d9cbc (patch) | |
| tree | 5f6707ec90be57c46457b9d6da7846dcff908095 /src/test/rustdoc-ui | |
| parent | 213dc41fe7e9e4ab56a58d7048deaa658015bc44 (diff) | |
| download | rust-23a2ba6e53cd5cd8c4cc2f75cc1e7d2ac20d9cbc.tar.gz rust-23a2ba6e53cd5cd8c4cc2f75cc1e7d2ac20d9cbc.zip | |
Add more tests for doc alias
Diffstat (limited to 'src/test/rustdoc-ui')
| -rw-r--r-- | src/test/rustdoc-ui/check-doc-alias-attr-location.rs | 13 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/check-doc-alias-attr-location.stderr | 20 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/check-doc-alias-attr-location.rs b/src/test/rustdoc-ui/check-doc-alias-attr-location.rs new file mode 100644 index 00000000000..e209da6e2c3 --- /dev/null +++ b/src/test/rustdoc-ui/check-doc-alias-attr-location.rs @@ -0,0 +1,13 @@ +#![feature(doc_alias)] + +pub struct Bar; +pub trait Foo {} + +#[doc(alias = "foo")] //~ ERROR +extern {} + +#[doc(alias = "bar")] //~ ERROR +impl Bar {} + +#[doc(alias = "foobar")] //~ ERROR +impl Foo for Bar {} diff --git a/src/test/rustdoc-ui/check-doc-alias-attr-location.stderr b/src/test/rustdoc-ui/check-doc-alias-attr-location.stderr new file mode 100644 index 00000000000..74adc1bc073 --- /dev/null +++ b/src/test/rustdoc-ui/check-doc-alias-attr-location.stderr @@ -0,0 +1,20 @@ +error: `#[doc(alias = "...")]` isn't allowed on extern block + --> $DIR/check-doc-alias-attr-location.rs:6:7 + | +LL | #[doc(alias = "foo")] + | ^^^^^^^^^^^^^ + +error: `#[doc(alias = "...")]` isn't allowed on implementation block + --> $DIR/check-doc-alias-attr-location.rs:9:7 + | +LL | #[doc(alias = "bar")] + | ^^^^^^^^^^^^^ + +error: `#[doc(alias = "...")]` isn't allowed on implementation block + --> $DIR/check-doc-alias-attr-location.rs:12:7 + | +LL | #[doc(alias = "foobar")] + | ^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + |
