1
+ use std:: sync:: Arc ;
1
2
use std:: ops:: ControlFlow ;
2
3
3
4
use clippy_config:: Conf ;
@@ -6,7 +7,6 @@ use clippy_utils::is_lint_allowed;
6
7
use clippy_utils:: source:: walk_span_to_context;
7
8
use clippy_utils:: visitors:: { Descend , for_each_expr} ;
8
9
use hir:: HirId ;
9
- use rustc_data_structures:: sync:: Lrc ;
10
10
use rustc_hir as hir;
11
11
use rustc_hir:: { Block , BlockCheckMode , ItemKind , Node , UnsafeSource } ;
12
12
use rustc_lexer:: { TokenKind , tokenize} ;
@@ -480,7 +480,7 @@ fn item_has_safety_comment(cx: &LateContext<'_>, item: &hir::Item<'_>) -> HasSaf
480
480
if let Some ( comment_start) = comment_start
481
481
&& let Ok ( unsafe_line) = source_map. lookup_line ( item. span . lo ( ) )
482
482
&& let Ok ( comment_start_line) = source_map. lookup_line ( comment_start)
483
- && Lrc :: ptr_eq ( & unsafe_line. sf , & comment_start_line. sf )
483
+ && Arc :: ptr_eq ( & unsafe_line. sf , & comment_start_line. sf )
484
484
&& let Some ( src) = unsafe_line. sf . src . as_deref ( )
485
485
{
486
486
return if comment_start_line. line >= unsafe_line. line {
@@ -520,7 +520,7 @@ fn stmt_has_safety_comment(cx: &LateContext<'_>, span: Span, hir_id: HirId) -> H
520
520
if let Some ( comment_start) = comment_start
521
521
&& let Ok ( unsafe_line) = source_map. lookup_line ( span. lo ( ) )
522
522
&& let Ok ( comment_start_line) = source_map. lookup_line ( comment_start)
523
- && Lrc :: ptr_eq ( & unsafe_line. sf , & comment_start_line. sf )
523
+ && Arc :: ptr_eq ( & unsafe_line. sf , & comment_start_line. sf )
524
524
&& let Some ( src) = unsafe_line. sf . src . as_deref ( )
525
525
{
526
526
return if comment_start_line. line >= unsafe_line. line {
@@ -580,7 +580,7 @@ fn span_from_macro_expansion_has_safety_comment(cx: &LateContext<'_>, span: Span
580
580
// ^--------------------------------------------^
581
581
if let Ok ( unsafe_line) = source_map. lookup_line ( span. lo ( ) )
582
582
&& let Ok ( macro_line) = source_map. lookup_line ( ctxt. outer_expn_data ( ) . def_site . lo ( ) )
583
- && Lrc :: ptr_eq ( & unsafe_line. sf , & macro_line. sf )
583
+ && Arc :: ptr_eq ( & unsafe_line. sf , & macro_line. sf )
584
584
&& let Some ( src) = unsafe_line. sf . src . as_deref ( )
585
585
{
586
586
if macro_line. line < unsafe_line. line {
@@ -641,7 +641,7 @@ fn span_has_safety_comment(cx: &LateContext<'_>, span: Span) -> bool {
641
641
if let Ok ( unsafe_line) = source_map. lookup_line ( span. lo ( ) )
642
642
&& let Some ( body_span) = walk_span_to_context ( search_span, SyntaxContext :: root ( ) )
643
643
&& let Ok ( body_line) = source_map. lookup_line ( body_span. lo ( ) )
644
- && Lrc :: ptr_eq ( & unsafe_line. sf , & body_line. sf )
644
+ && Arc :: ptr_eq ( & unsafe_line. sf , & body_line. sf )
645
645
&& let Some ( src) = unsafe_line. sf . src . as_deref ( )
646
646
{
647
647
// Get the text from the start of function body to the unsafe block.
0 commit comments