Skip to content

Commit 23a2ba6

Browse files
Add more tests for doc alias
1 parent 213dc41 commit 23a2ba6

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#![feature(doc_alias)]
2+
3+
pub struct Bar;
4+
pub trait Foo {}
5+
6+
#[doc(alias = "foo")] //~ ERROR
7+
extern {}
8+
9+
#[doc(alias = "bar")] //~ ERROR
10+
impl Bar {}
11+
12+
#[doc(alias = "foobar")] //~ ERROR
13+
impl Foo for Bar {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error: `#[doc(alias = "...")]` isn't allowed on extern block
2+
--> $DIR/check-doc-alias-attr-location.rs:6:7
3+
|
4+
LL | #[doc(alias = "foo")]
5+
| ^^^^^^^^^^^^^
6+
7+
error: `#[doc(alias = "...")]` isn't allowed on implementation block
8+
--> $DIR/check-doc-alias-attr-location.rs:9:7
9+
|
10+
LL | #[doc(alias = "bar")]
11+
| ^^^^^^^^^^^^^
12+
13+
error: `#[doc(alias = "...")]` isn't allowed on implementation block
14+
--> $DIR/check-doc-alias-attr-location.rs:12:7
15+
|
16+
LL | #[doc(alias = "foobar")]
17+
| ^^^^^^^^^^^^^^^^
18+
19+
error: aborting due to 3 previous errors
20+

0 commit comments

Comments
 (0)