11//! This pass is overloaded and runs two different lints.
22//!
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.
44//! - PRIVATE_DOC_TESTS: this lint is **STABLE** and looks for private items with doctests.
55
66use super :: Pass ;
@@ -15,23 +15,23 @@ use rustc_middle::lint::LintLevelSource;
1515use rustc_session:: lint;
1616use rustc_span:: symbol:: sym;
1717
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 " ,
2222} ;
2323
24- struct PrivateItemDocTestLinter < ' a , ' tcx > {
24+ struct DocTestVisibilityLinter < ' a , ' tcx > {
2525 cx : & ' a mut DocContext < ' tcx > ,
2626}
2727
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 } ;
3030
3131 coll. fold_crate ( krate)
3232}
3333
34- impl < ' a , ' tcx > DocFolder for PrivateItemDocTestLinter < ' a , ' tcx > {
34+ impl < ' a , ' tcx > DocFolder for DocTestVisibilityLinter < ' a , ' tcx > {
3535 fn fold_item ( & mut self , item : Item ) -> Option < Item > {
3636 let dox = item. attrs . collapsed_doc_value ( ) . unwrap_or_else ( String :: new) ;
3737
0 commit comments