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:
bors
2022-07-08 03:05:15 +00:00
175 changed files with 957 additions and 1341 deletions

View File

@@ -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)