From c759aea5b3426ebf6f6e3caf7d9c60721a26cb32 Mon Sep 17 00:00:00 2001 From: Josh Date: Thu, 19 Jan 2017 08:31:29 +1100 Subject: [PATCH 1/2] Stop warning when doc testing proc macro crates Add the actually_rustdoc option to the session that is passed to phase_2_configure_and_expand function inside the rustdoc test module. This prevents the warning code from triggering when parsing proc_macro_derive attributes, just like when `--test` is normally invoked. --- src/librustdoc/test.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index c242eea2362..26f331ac7d1 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -67,6 +67,7 @@ pub fn run(input: &str, crate_types: vec![config::CrateTypeDylib], externs: externs.clone(), unstable_features: UnstableFeatures::from_environment(), + actually_rustdoc: true, ..config::basic_options().clone() }; From d492433744d76e12151716ae688295570ebc5375 Mon Sep 17 00:00:00 2001 From: Josh Date: Thu, 19 Jan 2017 09:31:55 +1100 Subject: [PATCH 2/2] Add doctest to the proc-macro derive-test --- src/test/run-pass-fulldeps/proc-macro/derive-test.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/run-pass-fulldeps/proc-macro/derive-test.rs b/src/test/run-pass-fulldeps/proc-macro/derive-test.rs index a07e8b6cd7e..5a53a4e8db3 100644 --- a/src/test/run-pass-fulldeps/proc-macro/derive-test.rs +++ b/src/test/run-pass-fulldeps/proc-macro/derive-test.rs @@ -17,6 +17,9 @@ extern crate proc_macro; use proc_macro::TokenStream; +// ``` +// assert!(true); +// ``` #[proc_macro_derive(Foo)] pub fn derive_foo(_input: TokenStream) -> TokenStream { "".parse().unwrap()