Add more tests for doc alias
This commit is contained in:
parent
213dc41fe7
commit
23a2ba6e53
2 changed files with 33 additions and 0 deletions
13
src/test/rustdoc-ui/check-doc-alias-attr-location.rs
Normal file
13
src/test/rustdoc-ui/check-doc-alias-attr-location.rs
Normal 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 {}
|
20
src/test/rustdoc-ui/check-doc-alias-attr-location.stderr
Normal file
20
src/test/rustdoc-ui/check-doc-alias-attr-location.stderr
Normal 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
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue