Skip to content

Commit

Permalink
Unrolled build for rust-lang#129192
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#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`
  • Loading branch information
rust-timer authored Aug 17, 2024
2 parents 9b318d2 + 7bde314 commit f6045c9
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/librustdoc/doctest/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ impl DocTestRunner {
#![allow(internal_features)]
#![feature(test)]
#![feature(rustc_attrs)]
#![feature(coverage_attribute)]
"
.to_string();

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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}}},
));
}}",
Expand Down

0 comments on commit f6045c9

Please sign in to comment.