1
Fork 0

Handle safety keyword for extern block inner items

This commit is contained in:
Santiago Pastorino 2024-05-23 10:01:05 -03:00
parent bbddc9b58f
commit 2a377122dd
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
52 changed files with 168 additions and 84 deletions

View file

@ -886,7 +886,7 @@ impl<'hir> Map<'hir> {
Node::Variant(variant) => named_span(variant.span, variant.ident, None),
Node::ImplItem(item) => named_span(item.span, item.ident, Some(item.generics)),
Node::ForeignItem(item) => match item.kind {
ForeignItemKind::Fn(decl, _, _) => until_within(item.span, decl.output.span()),
ForeignItemKind::Fn(decl, _, _, _) => until_within(item.span, decl.output.span()),
_ => named_span(item.span, item.ident, None),
},
Node::Ctor(_) => return self.span(self.tcx.parent_hir_id(hir_id)),

View file

@ -201,7 +201,7 @@ pub fn provide(providers: &mut Providers) {
..
})
| Node::ForeignItem(&ForeignItem {
kind: ForeignItemKind::Fn(_, idents, _),
kind: ForeignItemKind::Fn(_, idents, _, _),
..
}) = tcx.hir_node(tcx.local_def_id_to_hir_id(def_id))
{