use crate::{
common::{GenericId, ItemId, TyDefId},
sem::generic::GenericArgs,
};
use super::CommonTyData;
#[repr(C)]
#[derive(Debug)]
#[cfg_attr(feature = "driver-api", derive(typed_builder::TypedBuilder))]
pub struct AdtTy<'ast> {
data: CommonTyData<'ast>,
def_id: TyDefId,
generics: GenericArgs<'ast>,
}
impl<'ast> AdtTy<'ast> {
pub fn def_id(&self) -> TyDefId {
self.def_id
}
pub fn generics(&self) -> &GenericArgs<'ast> {
&self.generics
}
}
super::impl_ty_data!(AdtTy<'ast>, Adt);
#[repr(C)]
#[derive(Debug)]
#[cfg_attr(feature = "driver-api", derive(typed_builder::TypedBuilder))]
pub struct GenericTy<'ast> {
data: CommonTyData<'ast>,
generic_id: GenericId,
}
impl<'ast> GenericTy<'ast> {
pub fn generic_id(&self) -> GenericId {
self.generic_id
}
}
super::impl_ty_data!(GenericTy<'ast>, Generic);
#[repr(C)]
#[derive(Debug)]
#[cfg_attr(feature = "driver-api", derive(typed_builder::TypedBuilder))]
pub struct AliasTy<'ast> {
data: CommonTyData<'ast>,
alias_item: ItemId,
}
impl<'ast> AliasTy<'ast> {
pub fn alias_item(&self) -> ItemId {
self.alias_item
}
}
super::impl_ty_data!(AliasTy<'ast>, Alias);