Eagerly lower enum variants in CrateDefMap construction

This commit is contained in:
Lukas Wirth 2024-01-15 10:24:14 +01:00
parent 9d8889cdfc
commit d80d2fcae0
49 changed files with 553 additions and 593 deletions

View file

@ -18,10 +18,7 @@ pub(crate) struct Trace<T, V> {
}
impl<T, V> Trace<T, V> {
pub(crate) fn new_for_arena() -> Trace<T, V> {
Trace { arena: Some(Arena::default()), map: None, len: 0 }
}
#[allow(dead_code)]
pub(crate) fn new_for_map() -> Trace<T, V> {
Trace { arena: None, map: Some(ArenaMap::default()), len: 0 }
}
@ -41,6 +38,7 @@ impl<T, V> Trace<T, V> {
id
}
#[allow(dead_code)]
pub(crate) fn into_arena(mut self) -> Arena<T> {
self.arena.take().unwrap()
}