Auto merge of #98482 - cjgillot:short-struct-span-closure, r=estebank
Shorten def_span of closures to just their header Continuation of https://github.com/rust-lang/rust/pull/93967.
This commit is contained in:
@@ -1021,6 +1021,7 @@ impl<'hir> Map<'hir> {
|
||||
_ => named_span(item.span, item.ident, None),
|
||||
},
|
||||
Node::Ctor(_) => return self.opt_span(self.get_parent_node(hir_id)),
|
||||
Node::Expr(Expr { kind: ExprKind::Closure { fn_decl_span, .. }, .. }) => *fn_decl_span,
|
||||
_ => self.span_with_body(hir_id),
|
||||
};
|
||||
Some(span)
|
||||
|
||||
Reference in New Issue
Block a user