Skip to content

Commit

Permalink
Add some debug implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 16, 2019
1 parent d81d057 commit 7fe3b21
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/librustdoc/passes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ pub fn look_for_tests<'tcx>(
}
};

#[derive(Debug)]
struct Tests {
found_tests: usize,
}
Expand Down
15 changes: 14 additions & 1 deletion src/librustdoc/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use crate::clean::Attributes;
use crate::config::Options;
use crate::html::markdown::{self, ErrorCodes, LangString, Ignore};

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

impl ::std::fmt::Debug for Collector {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.debug_struct("Collector")
.field("tests", &self.tests)
.field("options", &self.options)
.field("use_headers", &self.use_headers)
.field("enable_per_target_ignores", &self.enable_per_target_ignores)
.field("cratename", &self.cratename)
.field("opts", &self.opts)
.finish()
}
}

impl Collector {
pub fn new(cratename: String, options: Options, use_headers: bool, opts: TestOptions,
source_map: Option<Lrc<SourceMap>>, filename: Option<PathBuf>,
Expand Down

0 comments on commit 7fe3b21

Please sign in to comment.