Skip to content

Commit 78eae0f

Browse files
committed
Remove renaming of test crate
This is leftover from when `doctest` used to be called `test`. Remove it now, it's unnecessary and makes the code harder to read.
1 parent 3e1c75c commit 78eae0f

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

src/librustdoc/doctest.rs

+8-12
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,7 @@ crate fn run(options: Options) -> Result<(), ErrorReported> {
167167

168168
test_args.insert(0, "rustdoctest".to_string());
169169

170-
testing::test_main(
171-
&test_args,
172-
tests,
173-
Some(testing::Options::new().display_output(display_warnings)),
174-
);
170+
test::test_main(&test_args, tests, Some(test::Options::new().display_output(display_warnings)));
175171

176172
// Collect and warn about unused externs, but only if we've gotten
177173
// reports for each doctest
@@ -769,7 +765,7 @@ crate trait Tester {
769765
}
770766

771767
crate struct Collector {
772-
crate tests: Vec<testing::TestDescAndFn>,
768+
crate tests: Vec<test::TestDescAndFn>,
773769

774770
// The name of the test displayed to the user, separated by `::`.
775771
//
@@ -930,22 +926,22 @@ impl Tester for Collector {
930926
};
931927

932928
debug!("creating test {}: {}", name, test);
933-
self.tests.push(testing::TestDescAndFn {
934-
desc: testing::TestDesc {
935-
name: testing::DynTestName(name),
929+
self.tests.push(test::TestDescAndFn {
930+
desc: test::TestDesc {
931+
name: test::DynTestName(name),
936932
ignore: match config.ignore {
937933
Ignore::All => true,
938934
Ignore::None => false,
939935
Ignore::Some(ref ignores) => ignores.iter().any(|s| target_str.contains(s)),
940936
},
941937
// compiler failures are test failures
942-
should_panic: testing::ShouldPanic::No,
938+
should_panic: test::ShouldPanic::No,
943939
allow_fail: config.allow_fail,
944940
compile_fail: config.compile_fail,
945941
no_run,
946-
test_type: testing::TestType::DocTest,
942+
test_type: test::TestType::DocTest,
947943
},
948-
testfn: testing::DynTestFn(box move || {
944+
testfn: test::DynTestFn(box move || {
949945
let report_unused_externs = |uext| {
950946
unused_externs.lock().unwrap().push(uext);
951947
};

src/librustdoc/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ extern crate rustc_span as rustc_span;
5757
extern crate rustc_target;
5858
extern crate rustc_trait_selection;
5959
extern crate rustc_typeck;
60-
extern crate test as testing;
60+
extern crate test;
6161

6262
#[cfg(feature = "jemalloc")]
6363
extern crate tikv_jemalloc_sys;

src/librustdoc/markdown.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ crate fn test(mut options: Options) -> Result<(), String> {
136136
find_testable_code(&input_str, &mut collector, codes, options.enable_per_target_ignores, None);
137137

138138
options.test_args.insert(0, "rustdoctest".to_string());
139-
testing::test_main(
139+
test::test_main(
140140
&options.test_args,
141141
collector.tests,
142-
Some(testing::Options::new().display_output(options.display_warnings)),
142+
Some(test::Options::new().display_output(options.display_warnings)),
143143
);
144144
Ok(())
145145
}

0 commit comments

Comments
 (0)