Skip to content

Commit dc9c4ad

Browse files
committed
rustdoc: add doc comment to DocVisitor
1 parent fd2c811 commit dc9c4ad

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/librustdoc/visit.rs

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
use crate::clean::*;
22

3+
/// allows a type to traverse the cleaned as of a crate.
4+
///
5+
/// note that like [`rustc_ast::visit::Visitor`], but
6+
/// unlike [`rustc_lint::EarlyLintPass`], if you override a
7+
/// `visit_*` method, you will need to manually recurse over
8+
/// its contents.
39
pub(crate) trait DocVisitor: Sized {
410
fn visit_item(&mut self, item: &Item) {
511
self.visit_item_recur(item)
@@ -58,6 +64,7 @@ pub(crate) trait DocVisitor: Sized {
5864
m.items.iter().for_each(|i| self.visit_item(i))
5965
}
6066

67+
/// the main entrypoint of [`DocVisitor`].
6168
fn visit_crate(&mut self, c: &Crate) {
6269
self.visit_item(&c.module);
6370

0 commit comments

Comments
 (0)