Skip to content

Commit 87ea994

Browse files
Remove span method from AttributesExt trait
1 parent de61a78 commit 87ea994

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/librustdoc/clean/types.rs

-4
Original file line numberDiff line numberDiff line change
@@ -878,10 +878,6 @@ pub(crate) trait AttributesExt {
878878

879879
fn iter<'a>(&'a self) -> Self::Attributes<'a>;
880880

881-
fn span(&self) -> Option<rustc_span::Span> {
882-
self.iter().find(|attr| attr.doc_str().is_some()).map(|attr| attr.span)
883-
}
884-
885881
fn cfg(&self, tcx: TyCtxt<'_>, hidden_cfg: &FxHashSet<Cfg>) -> Option<Arc<Cfg>> {
886882
let sess = tcx.sess;
887883
let doc_cfg_active = tcx.features().doc_cfg;

src/librustdoc/doctest.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1239,8 +1239,9 @@ impl<'a, 'hir, 'tcx> HirCollector<'a, 'hir, 'tcx> {
12391239
if let Some(doc) = attrs.collapsed_doc_value() {
12401240
// Use the outermost invocation, so that doctest names come from where the docs were written.
12411241
let span = ast_attrs
1242-
.span()
1243-
.map(|span| span.ctxt().outer_expn().expansion_cause().unwrap_or(span))
1242+
.iter()
1243+
.find(|attr| attr.doc_str().is_some())
1244+
.map(|attr| attr.span.ctxt().outer_expn().expansion_cause().unwrap_or(attr.span))
12441245
.unwrap_or(DUMMY_SP);
12451246
self.collector.set_position(span);
12461247
markdown::find_testable_code(

0 commit comments

Comments
 (0)