Skip to main content

resolve_aliases

Function resolve_aliases 

fn resolve_aliases(
    symbols: &mut BTreeMap<String, String>,
    aliases: &[(String, String)],
) -> Result<(), Error>
Expand description

Repoints every alias at the anchor its canonical target resolved to.

pystub’s canonicalize_aliases has already decided which of several names for one live class is canonical; this only follows that decision into the map. The target is looked up in the finished map rather than re-derived, so an alias to a submodule symbol lands on the submodule’s section exactly as the symbol itself does, with no second rule to keep in step.

§Errors

Error::Unclassifiable when the target has no entry. That cannot happen while both names come from the same introspection pass, and it is an error rather than a skip precisely because the alternative — leaving the alias pointing at an anchor minted from its own name — is the dead link check-api-links found in the map (atune.TrialPruned, §1.3.106’s successor).