@@ -9,7 +9,7 @@ use crate::clean;
9
9
use crate :: core:: DocContext ;
10
10
use crate :: fold:: DocFolder ;
11
11
use crate :: html:: markdown:: { self , RustCodeBlock } ;
12
- use crate :: passes:: { span_of_attrs , Pass } ;
12
+ use crate :: passes:: Pass ;
13
13
14
14
crate const CHECK_CODE_BLOCK_SYNTAX : Pass = Pass {
15
15
name : "check-code-block-syntax" ,
@@ -86,7 +86,7 @@ impl<'a, 'tcx> SyntaxChecker<'a, 'tcx> {
86
86
// We couldn't calculate the span of the markdown block that had the error, so our
87
87
// diagnostics are going to be a bit lacking.
88
88
let mut diag = self . cx . sess ( ) . struct_span_warn (
89
- super :: span_of_attrs ( & item. attrs ) . unwrap_or ( item . span . inner ( ) ) ,
89
+ item. attr_span ( self . cx . tcx ) ,
90
90
"doc comment contains an invalid Rust code block" ,
91
91
) ;
92
92
@@ -110,7 +110,7 @@ impl<'a, 'tcx> SyntaxChecker<'a, 'tcx> {
110
110
impl < ' a , ' tcx > DocFolder for SyntaxChecker < ' a , ' tcx > {
111
111
fn fold_item ( & mut self , item : clean:: Item ) -> Option < clean:: Item > {
112
112
if let Some ( dox) = & item. attrs . collapsed_doc_value ( ) {
113
- let sp = span_of_attrs ( & item. attrs ) . unwrap_or ( item . span . inner ( ) ) ;
113
+ let sp = item. attr_span ( self . cx . tcx ) ;
114
114
let extra = crate :: html:: markdown:: ExtraInfo :: new_did ( self . cx . tcx , item. def_id , sp) ;
115
115
for code_block in markdown:: rust_code_blocks ( & dox, & extra) {
116
116
self . check_rust_syntax ( & item, & dox, code_block) ;
0 commit comments