about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-08-17 18:18:20 +0200
committerGitHub <noreply@github.com>2024-08-17 18:18:20 +0200
commit8a023b31bd408868d4fa6493a657a32ab1b30868 (patch)
treeea9925ebc1ecf276243bd7713aaa6222b3c5eb9d
parent1a95a5f2dbffc3f48e0515fd9bdfa77f2921872b (diff)
parent7bde314de8cef42a1848b48cd5084f5d6c26549f (diff)
downloadrust-8a023b31bd408868d4fa6493a657a32ab1b30868.tar.gz
rust-8a023b31bd408868d4fa6493a657a32ab1b30868.zip
Rollup merge of #129192 - GuillaumeGomez:rm-useless-merged-doctest-attrs, r=notriddle
Remove useless attributes in merged doctest generated code

I took another look at the generated code for merged doctests and it seems like those attributes are only useful when running `rustc --test`, which isn't the case for merged doctests. Less code generated. \o/

r? `@notriddle`
-rw-r--r--src/librustdoc/doctest/runner.rs4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/librustdoc/doctest/runner.rs b/src/librustdoc/doctest/runner.rs
index b91333e5f81..d49fa3ac5ac 100644
--- a/src/librustdoc/doctest/runner.rs
+++ b/src/librustdoc/doctest/runner.rs
@@ -75,7 +75,6 @@ impl DocTestRunner {
 #![allow(internal_features)]
 #![feature(test)]
 #![feature(rustc_attrs)]
-#![feature(coverage_attribute)]
 "
         .to_string();
 
@@ -135,7 +134,6 @@ mod __doctest_mod {{
 }}
 
 #[rustc_main]
-#[coverage(off)]
 fn main() -> std::process::ExitCode {{
 const TESTS: [test::TestDescAndFn; {nb_tests}] = [{ids}];
 let bin_marker = std::ffi::OsStr::new(__doctest_mod::BIN_OPTION);
@@ -235,11 +233,9 @@ fn main() {returns_result} {{
     writeln!(
         output,
         "
-#[rustc_test_marker = {test_name:?}]
 pub const TEST: test::TestDescAndFn = test::TestDescAndFn::new_doctest(
 {test_name:?}, {ignore}, {file:?}, {line}, {no_run}, {should_panic},
 test::StaticTestFn(
-    #[coverage(off)]
     || {{{runner}}},
 ));
 }}",