Skip to content

Commit 7fe3b21

Browse files
Add some debug implementations
1 parent d81d057 commit 7fe3b21

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/librustdoc/passes/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ pub fn look_for_tests<'tcx>(
322322
}
323323
};
324324

325+
#[derive(Debug)]
325326
struct Tests {
326327
found_tests: usize,
327328
}

src/librustdoc/test.rs

+14-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use crate::clean::Attributes;
2626
use crate::config::Options;
2727
use crate::html::markdown::{self, ErrorCodes, LangString, Ignore};
2828

29-
#[derive(Clone, Default)]
29+
#[derive(Clone, Default, Debug)]
3030
pub struct TestOptions {
3131
/// Whether to disable the default `extern crate my_crate;` when creating doctests.
3232
pub no_crate_inject: bool,
@@ -640,6 +640,19 @@ pub struct Collector {
640640
filename: Option<PathBuf>,
641641
}
642642

643+
impl ::std::fmt::Debug for Collector {
644+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
645+
f.debug_struct("Collector")
646+
.field("tests", &self.tests)
647+
.field("options", &self.options)
648+
.field("use_headers", &self.use_headers)
649+
.field("enable_per_target_ignores", &self.enable_per_target_ignores)
650+
.field("cratename", &self.cratename)
651+
.field("opts", &self.opts)
652+
.finish()
653+
}
654+
}
655+
643656
impl Collector {
644657
pub fn new(cratename: String, options: Options, use_headers: bool, opts: TestOptions,
645658
source_map: Option<Lrc<SourceMap>>, filename: Option<PathBuf>,

0 commit comments

Comments
 (0)