1
Fork 0

Don't ICE on anonymous struct in enum variant

This commit is contained in:
clubby789 2024-02-22 17:22:40 +00:00
parent 1bb3a9f67a
commit 35a9e73521
4 changed files with 41 additions and 1 deletions

View file

@ -3004,6 +3004,11 @@ impl<'hir> Item<'hir> {
matches!(self.kind, ItemKind::Enum(..) | ItemKind::Struct(..) | ItemKind::Union(..))
}
/// Check if this is an [`ItemKind::Struct`] or [`ItemKind::Union`].
pub fn is_struct_or_union(&self) -> bool {
matches!(self.kind, ItemKind::Struct(..) | ItemKind::Union(..))
}
expect_methods_self_kind! {
expect_extern_crate, Option<Symbol>, ItemKind::ExternCrate(s), *s;