Auto merge of #39136 - keeperofdakeys:proc-macro-doc-test, r=alexcrichton

Stop warning when doc testing proc macro crates

Fixes #39064

Add the test option to the session struct 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.

This change makes the warning disappear, but I'm not sure what else it might change. So this early PR is mainly to run the test suite, and to get feedback.
This commit is contained in:
bors 2017-01-19 21:15:12 +00:00
commit f0b4207598
2 changed files with 4 additions and 0 deletions

View file

@ -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()
};

View file

@ -17,6 +17,9 @@
use proc_macro::TokenStream;
// ```
// assert!(true);
// ```
#[proc_macro_derive(Foo)]
pub fn derive_foo(_input: TokenStream) -> TokenStream {
"".parse().unwrap()