diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-09-05 12:11:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-05 12:11:07 +0200 |
| commit | d855bde45728cf8716a0adcdecd98815e4faabd5 (patch) | |
| tree | 3e75ee0930f3de231827bf132b79ef377848cbe8 /src/test/rustdoc | |
| parent | 6da74a26059c3d6e60d0b9af28499a74daacf26a (diff) | |
| parent | 7ed542da7815070b4fc7aa87d53e5b97aa2e8828 (diff) | |
| download | rust-d855bde45728cf8716a0adcdecd98815e4faabd5.tar.gz rust-d855bde45728cf8716a0adcdecd98815e4faabd5.zip | |
Rollup merge of #63930 - estebank:rustdoc-ice, r=GuillaumeGomez
Account for doc comments coming from proc macros without spans Fix https://github.com/rust-lang/rust/issues/63821.
Diffstat (limited to 'src/test/rustdoc')
| -rw-r--r-- | src/test/rustdoc/auxiliary/through-proc-macro-aux.rs | 20 | ||||
| -rw-r--r-- | src/test/rustdoc/through-proc-macro.rs | 12 |
2 files changed, 32 insertions, 0 deletions
diff --git a/src/test/rustdoc/auxiliary/through-proc-macro-aux.rs b/src/test/rustdoc/auxiliary/through-proc-macro-aux.rs new file mode 100644 index 00000000000..5c4a01ee3a7 --- /dev/null +++ b/src/test/rustdoc/auxiliary/through-proc-macro-aux.rs @@ -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 +} diff --git a/src/test/rustdoc/through-proc-macro.rs b/src/test/rustdoc/through-proc-macro.rs new file mode 100644 index 00000000000..348c9eea2dc --- /dev/null +++ b/src/test/rustdoc/through-proc-macro.rs @@ -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() {} |
