diff --git a/src/librustdoc/doctest.rs b/src/librustdoc/doctest.rs index 6c776be58eb..442e833d720 100644 --- a/src/librustdoc/doctest.rs +++ b/src/librustdoc/doctest.rs @@ -846,13 +846,14 @@ fn add_test(&mut self, test: String, config: LangString, line: usize) { test_type: testing::TestType::DocTest, }, testfn: testing::DynTestFn(box move || { + let option_no_run = options.no_run; let res = run_test( &test, &cratename, line, options, config.should_panic, - config.no_run || options.no_run, + config.no_run || option_no_run, config.test_harness, runtool, runtool_args,