use crate::{common::SymbolId, context::with_cx};
use super::CommonItemData;
#[repr(C)]
#[derive(Debug)]
pub struct ExternCrateItem<'ast> {
data: CommonItemData<'ast>,
crate_name: SymbolId,
}
super::impl_item_data!(ExternCrateItem, ExternCrate);
impl<'ast> ExternCrateItem<'ast> {
pub fn crate_name(&self) -> &str {
with_cx(self, |cx| cx.symbol_str(self.crate_name))
}
}
#[cfg(feature = "driver-api")]
impl<'ast> ExternCrateItem<'ast> {
pub fn new(data: CommonItemData<'ast>, crate_name: SymbolId) -> Self {
Self { data, crate_name }
}
}