Add a helper method for extracting spans from AttrArgsEq
This commit is contained in:
parent
778321d155
commit
c0b532277b
3 changed files with 14 additions and 9 deletions
|
@ -220,9 +220,9 @@ pub fn attrs_to_doc_fragments<'a>(
|
|||
|
||||
fn span_for_value(attr: &ast::Attribute) -> Span {
|
||||
if let ast::AttrKind::Normal(normal) = &attr.kind
|
||||
&& let ast::AttrArgs::Eq { value: ast::AttrArgsEq::Hir(meta), .. } = &normal.item.args
|
||||
&& let ast::AttrArgs::Eq { value, .. } = &normal.item.args
|
||||
{
|
||||
meta.span.with_ctxt(attr.span.ctxt())
|
||||
value.span().with_ctxt(attr.span.ctxt())
|
||||
} else {
|
||||
attr.span
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue