File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -61,23 +61,22 @@ impl LateLintPass<'_> for UndocumentedUnsafeBlocks {
6161 if !in_external_macro( cx. tcx. sess, block. span) ;
6262 if let BlockCheckMode :: UnsafeBlock ( UnsafeSource :: UserProvided ) = block. rules;
6363 if let Some ( enclosing_scope_hir_id) = cx. tcx. hir( ) . get_enclosing_scope( block. hir_id) ;
64+ if block_has_safety_comment( cx. tcx, enclosing_scope_hir_id, block. span) == Some ( false ) ;
6465 then {
65- if block_has_safety_comment( cx. tcx, enclosing_scope_hir_id, block. span) == Some ( false ) {
66- let mut span = block. span;
66+ let mut span = block. span;
6767
68- if let Some ( local_span) = self . local_span {
69- span = local_span;
68+ if let Some ( local_span) = self . local_span {
69+ span = local_span;
7070
71- let result = block_has_safety_comment( cx. tcx, enclosing_scope_hir_id, span) ;
71+ let result = block_has_safety_comment( cx. tcx, enclosing_scope_hir_id, span) ;
7272
73- if result == Some ( true ) || result. is_none( ) {
74- self . local_checked = true ;
75- return ;
76- }
73+ if result == Some ( true ) || result. is_none( ) {
74+ self . local_checked = true ;
75+ return ;
7776 }
78-
79- err( cx, span) ;
8077 }
78+
79+ err( cx, span) ;
8180 }
8281 }
8382 }
You can’t perform that action at this time.
0 commit comments