Encode LangItem directly
This commit is contained in:
parent
99de57ae13
commit
ebfa1f0185
6 changed files with 21 additions and 34 deletions
|
@ -42,7 +42,7 @@ macro_rules! expand_group {
|
|||
pub struct LanguageItems {
|
||||
/// Mappings from lang items to their possibly found [`DefId`]s.
|
||||
/// The index corresponds to the order in [`LangItem`].
|
||||
pub items: Vec<Option<DefId>>,
|
||||
items: Vec<Option<DefId>>,
|
||||
/// Lang items that were not found during collection.
|
||||
pub missing: Vec<LangItem>,
|
||||
/// Mapping from [`LangItemGroup`] discriminants to all
|
||||
|
@ -133,11 +133,6 @@ macro_rules! language_item_table {
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns the mappings to the possibly found `DefId`s for each lang item.
|
||||
pub fn items(&self) -> &[Option<DefId>] {
|
||||
&*self.items
|
||||
}
|
||||
|
||||
/// Returns the [`DefId`]s of all lang items in a group.
|
||||
pub fn group(&self, group: LangItemGroup) -> &[DefId] {
|
||||
self.groups[group as usize].as_ref()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue