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;
10
10
use rustc_ast:: ast;
11
11
use rustc_hir as hir;
12
12
use rustc_lint:: { LateContext , LateLintPass , LintContext } ;
13
- use rustc_middle:: ty;
13
+ use rustc_middle:: ty:: { self , DefIdTree } ;
14
14
use rustc_session:: { declare_tool_lint, impl_lint_pass} ;
15
15
use rustc_span:: def_id:: CRATE_DEF_ID ;
16
16
use rustc_span:: source_map:: Span ;
@@ -114,8 +114,8 @@ impl<'tcx> LateLintPass<'tcx> for MissingDoc {
114
114
hir:: ItemKind :: Fn ( ..) => {
115
115
// ignore main()
116
116
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 {
119
119
return ;
120
120
}
121
121
}
You can’t perform that action at this time.
0 commit comments