@@ -9,7 +9,7 @@ use crate::clean;
99use crate :: core:: DocContext ;
1010use crate :: fold:: DocFolder ;
1111use crate :: html:: markdown:: { self , RustCodeBlock } ;
12- use crate :: passes:: { span_of_attrs , Pass } ;
12+ use crate :: passes:: Pass ;
1313
1414crate const CHECK_CODE_BLOCK_SYNTAX : Pass = Pass {
1515 name : "check-code-block-syntax" ,
@@ -86,7 +86,7 @@ impl<'a, 'tcx> SyntaxChecker<'a, 'tcx> {
8686 // We couldn't calculate the span of the markdown block that had the error, so our
8787 // diagnostics are going to be a bit lacking.
8888 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 ) ,
9090 "doc comment contains an invalid Rust code block" ,
9191 ) ;
9292
@@ -110,7 +110,7 @@ impl<'a, 'tcx> SyntaxChecker<'a, 'tcx> {
110110impl < ' a , ' tcx > DocFolder for SyntaxChecker < ' a , ' tcx > {
111111 fn fold_item ( & mut self , item : clean:: Item ) -> Option < clean:: Item > {
112112 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 ) ;
114114 let extra = crate :: html:: markdown:: ExtraInfo :: new_did ( self . cx . tcx , item. def_id , sp) ;
115115 for code_block in markdown:: rust_code_blocks ( & dox, & extra) {
116116 self . check_rust_syntax ( & item, & dox, code_block) ;
0 commit comments