@@ -10,10 +10,10 @@ use rustc_errors::Applicability;
10
10
use std:: lazy:: SyncLazy ;
11
11
use std:: mem;
12
12
13
- crate const CHECK_NON_AUTOLINKS : Pass = Pass {
14
- name : "check-non-autolinks " ,
15
- run : check_non_autolinks ,
16
- description : "detects URLs that could be linkified " ,
13
+ crate const CHECK_BARE_URLS : Pass = Pass {
14
+ name : "check-bare-urls " ,
15
+ run : check_bare_urls ,
16
+ description : "detects URLs that are not hyperlinks " ,
17
17
} ;
18
18
19
19
const URL_REGEX : SyncLazy < Regex > = SyncLazy :: new ( || {
@@ -26,11 +26,11 @@ const URL_REGEX: SyncLazy<Regex> = SyncLazy::new(|| {
26
26
. expect ( "failed to build regex" )
27
27
} ) ;
28
28
29
- struct NonAutolinksLinter < ' a , ' tcx > {
29
+ struct BareUrlsLinter < ' a , ' tcx > {
30
30
cx : & ' a mut DocContext < ' tcx > ,
31
31
}
32
32
33
- impl < ' a , ' tcx > NonAutolinksLinter < ' a , ' tcx > {
33
+ impl < ' a , ' tcx > BareUrlsLinter < ' a , ' tcx > {
34
34
fn find_raw_urls (
35
35
& self ,
36
36
text : & str ,
@@ -52,11 +52,11 @@ impl<'a, 'tcx> NonAutolinksLinter<'a, 'tcx> {
52
52
}
53
53
}
54
54
55
- crate fn check_non_autolinks ( krate : Crate , cx : & mut DocContext < ' _ > ) -> Crate {
56
- NonAutolinksLinter { cx } . fold_crate ( krate)
55
+ crate fn check_bare_urls ( krate : Crate , cx : & mut DocContext < ' _ > ) -> Crate {
56
+ BareUrlsLinter { cx } . fold_crate ( krate)
57
57
}
58
58
59
- impl < ' a , ' tcx > DocFolder for NonAutolinksLinter < ' a , ' tcx > {
59
+ impl < ' a , ' tcx > DocFolder for BareUrlsLinter < ' a , ' tcx > {
60
60
fn fold_item ( & mut self , item : Item ) -> Option < Item > {
61
61
let hir_id = match DocContext :: as_local_hir_id ( self . cx . tcx , item. def_id ) {
62
62
Some ( hir_id) => hir_id,
@@ -71,7 +71,7 @@ impl<'a, 'tcx> DocFolder for NonAutolinksLinter<'a, 'tcx> {
71
71
let sp = super :: source_span_for_markdown_range ( cx. tcx , & dox, & range, & item. attrs )
72
72
. or_else ( || span_of_attrs ( & item. attrs ) )
73
73
. unwrap_or ( item. span . inner ( ) ) ;
74
- cx. tcx . struct_span_lint_hir ( crate :: lint:: NON_AUTOLINKS , hir_id, sp, |lint| {
74
+ cx. tcx . struct_span_lint_hir ( crate :: lint:: BARE_URLS , hir_id, sp, |lint| {
75
75
lint. build ( msg)
76
76
. span_suggestion (
77
77
sp,
0 commit comments