File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ use clippy_utils::diagnostics::span_lint;
1010use rustc_ast:: ast;
1111use rustc_hir as hir;
1212use rustc_lint:: { LateContext , LateLintPass , LintContext } ;
13- use rustc_middle:: ty;
13+ use rustc_middle:: ty:: { self , DefIdTree } ;
1414use rustc_session:: { declare_tool_lint, impl_lint_pass} ;
1515use rustc_span:: def_id:: CRATE_DEF_ID ;
1616use rustc_span:: source_map:: Span ;
@@ -114,8 +114,8 @@ impl<'tcx> LateLintPass<'tcx> for MissingDoc {
114114 hir:: ItemKind :: Fn ( ..) => {
115115 // ignore main()
116116 if it. ident . name == sym:: main {
117- let def_key = cx. tcx . hir ( ) . def_key ( it. def_id ) ;
118- if def_key . parent == Some ( hir :: def_id :: CRATE_DEF_INDEX ) {
117+ let at_root = cx. tcx . local_parent ( it. def_id ) == Some ( CRATE_DEF_ID ) ;
118+ if at_root {
119119 return ;
120120 }
121121 }
You can’t perform that action at this time.
0 commit comments