fn adt_kind -> wfcheck
This commit is contained in:
parent
cd8377d37e
commit
c19ed3bc5b
2 changed files with 13 additions and 13 deletions
|
|
@ -12,7 +12,6 @@ use crate::hir::def::{DefKind, Res};
|
|||
use crate::hir::def_id::{DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX};
|
||||
use crate::mir::mono::Linkage;
|
||||
use crate::ty::query::Providers;
|
||||
use crate::ty::AdtKind;
|
||||
use crate::util::nodemap::{FxHashSet, NodeMap};
|
||||
|
||||
use errors::FatalError;
|
||||
|
|
@ -2550,15 +2549,6 @@ impl ItemKind<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn adt_kind(&self) -> Option<AdtKind> {
|
||||
match *self {
|
||||
ItemKind::Struct(..) => Some(AdtKind::Struct),
|
||||
ItemKind::Union(..) => Some(AdtKind::Union),
|
||||
ItemKind::Enum(..) => Some(AdtKind::Enum),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn generics(&self) -> Option<&Generics<'_>> {
|
||||
Some(match *self {
|
||||
ItemKind::Fn(_, ref generics, _)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue