-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for proc macro resolution in intra doc links
- Loading branch information
1 parent
4eda3f7
commit e003c3e
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// force-host | ||
// no-prefer-dynamic | ||
// compile-flags: --crate-type proc-macro | ||
|
||
#![crate_type="proc-macro"] | ||
#![crate_name="intra_link_proc_macro_macro"] | ||
|
||
extern crate proc_macro; | ||
|
||
use proc_macro::TokenStream; | ||
|
||
#[proc_macro_derive(DeriveA)] | ||
pub fn a_derive(input: TokenStream) -> TokenStream { | ||
input | ||
} | ||
|
||
#[proc_macro_derive(DeriveB)] | ||
pub fn b_derive(input: TokenStream) -> TokenStream { | ||
input | ||
} | ||
|
||
#[proc_macro_attribute] | ||
pub fn attr_a(input: TokenStream, _args: TokenStream) -> TokenStream { | ||
input | ||
} | ||
|
||
#[proc_macro_attribute] | ||
pub fn attr_b(input: TokenStream, _args: TokenStream) -> TokenStream { | ||
input | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// aux-build:intra-link-proc-macro-macro.rs | ||
// build-aux-docs | ||
// @has intra_link_proc_macro/index.html | ||
#![deny(intra_doc_link_resolution_failure)] | ||
|
||
extern crate intra_link_proc_macro_macro; | ||
|
||
|
||
pub use intra_link_proc_macro_macro::{DeriveA, attr_a}; | ||
use intra_link_proc_macro_macro::{DeriveB, attr_b}; | ||
|
||
// @has - '//a/@href' '../intra_link_proc_macro/derive.DeriveA.html' | ||
// @has - '//a/@href' '../intra_link_proc_macro/attr.attr_a.html' | ||
// @has - '//a/@href' '../intra_link_proc_macro_macro/derive.DeriveB.html' | ||
// @has - '//a/@href' '../intra_link_proc_macro_macro/attr.attr_b.html' | ||
/// Link to [DeriveA], [attr_a], [DeriveB], [attr_b] | ||
pub struct Foo; |