Skip to content

Commit 6320ad0

Browse files
committed
Fix non_local_definitions lint in rustdoc
1 parent 7b6057d commit 6320ad0

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/librustdoc/doctest.rs

+7
Original file line numberDiff line numberDiff line change
@@ -1208,6 +1208,13 @@ impl Tester for Collector {
12081208
}
12091209
}
12101210

1211+
#[cfg(test)] // used in tests
1212+
impl Tester for Vec<usize> {
1213+
fn add_test(&mut self, _test: String, _config: LangString, line: usize) {
1214+
self.push(line);
1215+
}
1216+
}
1217+
12111218
struct HirCollector<'a, 'hir, 'tcx> {
12121219
sess: &'a Session,
12131220
collector: &'a mut Collector,

src/librustdoc/html/markdown/tests.rs

-5
Original file line numberDiff line numberDiff line change
@@ -480,11 +480,6 @@ fn test_markdown_html_escape() {
480480
#[test]
481481
fn test_find_testable_code_line() {
482482
fn t(input: &str, expect: &[usize]) {
483-
impl crate::doctest::Tester for Vec<usize> {
484-
fn add_test(&mut self, _test: String, _config: LangString, line: usize) {
485-
self.push(line);
486-
}
487-
}
488483
let mut lines = Vec::<usize>::new();
489484
find_testable_code(input, &mut lines, ErrorCodes::No, false, None, true);
490485
assert_eq!(lines, expect);

0 commit comments

Comments
 (0)