Skip to main content

uses_first_order

Function uses_first_order 

Source
pub fn uses_first_order<'a, I>(
    names: I,
    unit_uses: &HashMap<String, Vec<String>>,
) -> Vec<&'a String>
where I: IntoIterator<Item = &'a String>,
Expand description

Phase 5: resolve each unit’s uses clauses, checking the target exists, is a commons, and is not self-referential. Returns unit → deduplicated list of used commons; diagnostics go into errors. #1702 review: the order to check units in — every uses target before the units that use it, ties broken by name, so the order stays a function of the source alone (deterministic_diagnostic_order_behaviour). A generic function’s compared type parameters (#1688) are computed while its own unit is checked, in that unit’s environment, so an importer must come after. Units on a uses cycle (already an error) are appended in name order.