File tree 1 file changed +10
-11
lines changed
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 {
61
61
if !in_external_macro( cx. tcx. sess, block. span) ;
62
62
if let BlockCheckMode :: UnsafeBlock ( UnsafeSource :: UserProvided ) = block. rules;
63
63
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 ) ;
64
65
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;
67
67
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;
70
70
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) ;
72
72
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 ;
77
76
}
78
-
79
- err( cx, span) ;
80
77
}
78
+
79
+ err( cx, span) ;
81
80
}
82
81
}
83
82
}
You can’t perform that action at this time.
0 commit comments