1
1
//! This pass is overloaded and runs two different lints.
2
2
//!
3
- //! - MISSING_DOC_CODE_EXAMPLES: this lint is **UNSTABLE** and looks for public items missing doctests
3
+ //! - MISSING_DOC_CODE_EXAMPLES: this lint is **UNSTABLE** and looks for public items missing doctests.
4
4
//! - PRIVATE_DOC_TESTS: this lint is **STABLE** and looks for private items with doctests.
5
5
6
6
use super :: Pass ;
@@ -15,23 +15,23 @@ use rustc_middle::lint::LintLevelSource;
15
15
use rustc_session:: lint;
16
16
use rustc_span:: symbol:: sym;
17
17
18
- crate const CHECK_PRIVATE_ITEMS_DOC_TESTS : Pass = Pass {
19
- name : "check-private-items-doc-tests " ,
20
- run : check_private_items_doc_tests ,
21
- description : "check private items doc tests " ,
18
+ crate const CHECK_DOC_TEST_VISIBILITY : Pass = Pass {
19
+ name : "check_doc_test_visibility " ,
20
+ run : check_doc_test_visibility ,
21
+ description : "run various visibility-related lints on doctests " ,
22
22
} ;
23
23
24
- struct PrivateItemDocTestLinter < ' a , ' tcx > {
24
+ struct DocTestVisibilityLinter < ' a , ' tcx > {
25
25
cx : & ' a mut DocContext < ' tcx > ,
26
26
}
27
27
28
- crate fn check_private_items_doc_tests ( krate : Crate , cx : & mut DocContext < ' _ > ) -> Crate {
29
- let mut coll = PrivateItemDocTestLinter { cx } ;
28
+ crate fn check_doc_test_visibility ( krate : Crate , cx : & mut DocContext < ' _ > ) -> Crate {
29
+ let mut coll = DocTestVisibilityLinter { cx } ;
30
30
31
31
coll. fold_crate ( krate)
32
32
}
33
33
34
- impl < ' a , ' tcx > DocFolder for PrivateItemDocTestLinter < ' a , ' tcx > {
34
+ impl < ' a , ' tcx > DocFolder for DocTestVisibilityLinter < ' a , ' tcx > {
35
35
fn fold_item ( & mut self , item : Item ) -> Option < Item > {
36
36
let dox = item. attrs . collapsed_doc_value ( ) . unwrap_or_else ( String :: new) ;
37
37
0 commit comments