Skip to content

Commit f0b4207

Browse files
committed
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.
2 parents 8e29b4d + d492433 commit f0b4207

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/librustdoc/test.rs

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ pub fn run(input: &str,
6767
crate_types: vec![config::CrateTypeDylib],
6868
externs: externs.clone(),
6969
unstable_features: UnstableFeatures::from_environment(),
70+
actually_rustdoc: true,
7071
..config::basic_options().clone()
7172
};
7273

src/test/run-pass-fulldeps/proc-macro/derive-test.rs

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ extern crate proc_macro;
1717

1818
use proc_macro::TokenStream;
1919

20+
// ```
21+
// assert!(true);
22+
// ```
2023
#[proc_macro_derive(Foo)]
2124
pub fn derive_foo(_input: TokenStream) -> TokenStream {
2225
"".parse().unwrap()

0 commit comments

Comments
 (0)