|
9 | 9 | // except according to those terms.
|
10 | 10 |
|
11 | 11 | use std::collections::{BTreeMap, BTreeSet};
|
| 12 | +use std::fmt; |
12 | 13 | use std::path::PathBuf;
|
13 | 14 |
|
14 | 15 | use errors;
|
@@ -99,8 +100,47 @@ pub struct Options {
|
99 | 100 | pub render_options: RenderOptions,
|
100 | 101 | }
|
101 | 102 |
|
| 103 | +impl fmt::Debug for Options { |
| 104 | + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
| 105 | + struct FmtExterns<'a>(&'a Externs); |
| 106 | + |
| 107 | + impl<'a> fmt::Debug for FmtExterns<'a> { |
| 108 | + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
| 109 | + f.debug_map() |
| 110 | + .entries(self.0.iter()) |
| 111 | + .finish() |
| 112 | + } |
| 113 | + } |
| 114 | + |
| 115 | + f.debug_struct("Options") |
| 116 | + .field("input", &self.input) |
| 117 | + .field("crate_name", &self.crate_name) |
| 118 | + .field("error_format", &self.error_format) |
| 119 | + .field("libs", &self.libs) |
| 120 | + .field("externs", &FmtExterns(&self.externs)) |
| 121 | + .field("cfgs", &self.cfgs) |
| 122 | + .field("codegen_options", &"...") |
| 123 | + .field("debugging_options", &"...") |
| 124 | + .field("target", &self.target) |
| 125 | + .field("edition", &self.edition) |
| 126 | + .field("maybe_sysroot", &self.maybe_sysroot) |
| 127 | + .field("linker", &self.linker) |
| 128 | + .field("lint_opts", &self.lint_opts) |
| 129 | + .field("describe_lints", &self.describe_lints) |
| 130 | + .field("lint_cap", &self.lint_cap) |
| 131 | + .field("should_test", &self.should_test) |
| 132 | + .field("test_args", &self.test_args) |
| 133 | + .field("default_passes", &self.default_passes) |
| 134 | + .field("manual_passes", &self.manual_passes) |
| 135 | + .field("display_warnings", &self.display_warnings) |
| 136 | + .field("crate_version", &self.crate_version) |
| 137 | + .field("render_options", &self.render_options) |
| 138 | + .finish() |
| 139 | + } |
| 140 | +} |
| 141 | + |
102 | 142 | /// Configuration options for the HTML page-creation process.
|
103 |
| -#[derive(Clone)] |
| 143 | +#[derive(Clone, Debug)] |
104 | 144 | pub struct RenderOptions {
|
105 | 145 | /// Output directory to generate docs into. Defaults to `doc`.
|
106 | 146 | pub output: PathBuf,
|
|
0 commit comments