Skip to content

Commit

Permalink
add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Aug 27, 2019
1 parent b2b9b81 commit 7ed542d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/test/rustdoc/auxiliary/through-proc-macro-aux.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// force-host
// no-prefer-dynamic
#![crate_type = "proc-macro"]
#![crate_name="some_macros"]

extern crate proc_macro;
use proc_macro::TokenStream;

#[proc_macro_attribute]
pub fn first(_attr: TokenStream, item: TokenStream) -> TokenStream {
item // This doesn't erase the spans.
}

#[proc_macro_attribute]
pub fn second(_attr: TokenStream, item: TokenStream) -> TokenStream {
// Make a new `TokenStream` to erase the spans:
let mut out: TokenStream = TokenStream::new();
out.extend(item);
out
}
12 changes: 12 additions & 0 deletions src/test/rustdoc/through-proc-macro.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// aux-build:through-proc-macro-aux.rs
// build-aux-docs
#![warn(intra_doc_link_resolution_failure)]
extern crate some_macros;

#[some_macros::second]
pub enum Boom {
/// [Oooops]
Bam,
}

fn main() {}

0 comments on commit 7ed542d

Please sign in to comment.