Skip to content

Commit e003c3e

Browse files
committed
Add test for proc macro resolution in intra doc links
1 parent 4eda3f7 commit e003c3e

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// force-host
2+
// no-prefer-dynamic
3+
// compile-flags: --crate-type proc-macro
4+
5+
#![crate_type="proc-macro"]
6+
#![crate_name="intra_link_proc_macro_macro"]
7+
8+
extern crate proc_macro;
9+
10+
use proc_macro::TokenStream;
11+
12+
#[proc_macro_derive(DeriveA)]
13+
pub fn a_derive(input: TokenStream) -> TokenStream {
14+
input
15+
}
16+
17+
#[proc_macro_derive(DeriveB)]
18+
pub fn b_derive(input: TokenStream) -> TokenStream {
19+
input
20+
}
21+
22+
#[proc_macro_attribute]
23+
pub fn attr_a(input: TokenStream, _args: TokenStream) -> TokenStream {
24+
input
25+
}
26+
27+
#[proc_macro_attribute]
28+
pub fn attr_b(input: TokenStream, _args: TokenStream) -> TokenStream {
29+
input
30+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// aux-build:intra-link-proc-macro-macro.rs
2+
// build-aux-docs
3+
// @has intra_link_proc_macro/index.html
4+
#![deny(intra_doc_link_resolution_failure)]
5+
6+
extern crate intra_link_proc_macro_macro;
7+
8+
9+
pub use intra_link_proc_macro_macro::{DeriveA, attr_a};
10+
use intra_link_proc_macro_macro::{DeriveB, attr_b};
11+
12+
// @has - '//a/@href' '../intra_link_proc_macro/derive.DeriveA.html'
13+
// @has - '//a/@href' '../intra_link_proc_macro/attr.attr_a.html'
14+
// @has - '//a/@href' '../intra_link_proc_macro_macro/derive.DeriveB.html'
15+
// @has - '//a/@href' '../intra_link_proc_macro_macro/attr.attr_b.html'
16+
/// Link to [DeriveA], [attr_a], [DeriveB], [attr_b]
17+
pub struct Foo;

0 commit comments

Comments
 (0)