Skip to content

Commit fd7079b

Browse files
committed
Fix non_local_definitions lint in rustdoc
1 parent d00c8ac commit fd7079b

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
@@ -1194,6 +1194,13 @@ impl Tester for Collector {
11941194
}
11951195
}
11961196

1197+
#[cfg(test)] // used in tests
1198+
impl Tester for Vec<usize> {
1199+
fn add_test(&mut self, _test: String, _config: LangString, line: usize) {
1200+
self.push(line);
1201+
}
1202+
}
1203+
11971204
struct HirCollector<'a, 'hir, 'tcx> {
11981205
sess: &'a Session,
11991206
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)