1
Fork 0

Rebased and improved errors

This commit is contained in:
Deadbeef 2021-12-29 16:29:14 +08:00
parent b5235ea732
commit 6d6314f878
No known key found for this signature in database
GPG key ID: 6D017A96D8E6C2F9
9 changed files with 40 additions and 20 deletions

View file

@ -24,7 +24,7 @@ pub enum LangItemGroup {
Fn,
}
const NUM_GROUPS: usize = 1;
const NUM_GROUPS: usize = 2;
macro_rules! expand_group {
() => {
@ -99,11 +99,12 @@ macro_rules! language_item_table {
/// Construct an empty collection of lang items and no missing ones.
pub fn new() -> Self {
fn init_none(_: LangItem) -> Option<DefId> { None }
const EMPTY: Vec<DefId> = Vec::new();
Self {
items: vec![$(init_none(LangItem::$variant)),*],
missing: Vec::new(),
groups: [vec![]; NUM_GROUPS],
groups: [EMPTY; NUM_GROUPS],
}
}