1
Fork 0

Add more tests for doc alias

This commit is contained in:
Guillaume Gomez 2020-07-06 16:11:32 +02:00
parent 213dc41fe7
commit 23a2ba6e53
2 changed files with 33 additions and 0 deletions

View file

@ -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 {}

View file

@ -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