File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,8 @@ impl UndocumentedUnsafeBlocks {
149149 let lex_end = ( between_span. hi ( ) . 0 - source_file. start_pos . 0 ) as usize ;
150150 let src_str = source_file. src . as_ref ( ) ?[ lex_start..lex_end] . to_string ( ) ;
151151
152+ let source_start_pos = source_file. start_pos . 0 as usize + lex_start;
153+
152154 let mut pos = 0 ;
153155 let mut comment = false ;
154156
@@ -171,7 +173,7 @@ impl UndocumentedUnsafeBlocks {
171173 if comment {
172174 // Get the line number of the "comment" (really wherever the trailing whitespace ended)
173175 let comment_line_num = source_file
174- . lookup_file_pos_with_col_display ( BytePos ( ( lex_start + pos) . try_into ( ) . unwrap ( ) ) )
176+ . lookup_file_pos ( BytePos ( ( source_start_pos + pos) . try_into ( ) . unwrap ( ) ) )
175177 . 0 ;
176178 // Find the block/local's line number
177179 let block_line_num = tcx. sess . source_map ( ) . lookup_char_pos ( block_span. lo ( ) ) . line ;
Original file line number Diff line number Diff line change 1+ fn zero ( ) {
2+ // SAFETY:
3+ unsafe { 0 } ;
4+ }
Original file line number Diff line number Diff line change 1+ #![ warn( clippy:: undocumented_unsafe_blocks) ]
2+ #![ allow( clippy:: no_effect) ]
3+
4+ #[ path = "auxiliary/ice-7934-aux.rs" ]
5+ mod zero;
6+
7+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments