1
Fork 0

change stdlib circular dependencies handling

This commit is contained in:
Daniil Belov 2022-08-15 13:15:01 +03:00 committed by Vadim Petrochenkov
parent 098cf88022
commit b67271507d
5 changed files with 41 additions and 122 deletions

View file

@ -18,6 +18,12 @@ pub static WEAK_ITEMS_REFS: LazyLock<FxIndexMap<Symbol, LangItem>> = LazyLock::n
map
});
pub static WEAK_ITEMS_SYMBOLS: LazyLock<FxIndexMap<LangItem, Symbol>> = LazyLock::new(|| {
let mut map = FxIndexMap::default();
$(map.insert(LangItem::$item, sym::$sym);)*
map
});
pub fn link_name(attrs: &[ast::Attribute]) -> Option<Symbol>
{
lang_items::extract(attrs).and_then(|(name, _)| {