We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9e136a3 + 0cf5ffe commit ed7f3d7Copy full SHA for ed7f3d7
src/librustdoc/doctest/rust.rs
@@ -126,13 +126,19 @@ impl HirCollector<'_> {
126
})
127
.unwrap_or(DUMMY_SP)
128
};
129
+ // TEST(notriddle): fail if there's more than 5 tests in a single docblock
130
+ let test_count_before = self.collector.tests.len();
131
markdown::find_testable_code(
132
&doc,
133
&mut self.collector,
134
self.codes,
135
self.enable_per_target_ignores,
136
Some(&crate::html::markdown::ExtraInfo::new(self.tcx, def_id, span)),
137
);
138
+ let test_count_after = self.collector.tests.len();
139
+ if test_count_after - test_count_before > 5 {
140
+ self.tcx.sess.dcx().fatal(format!("{def_id:?} has more than five doctests"));
141
+ }
142
}
143
144
nested(self);
0 commit comments