Skip to main content

union_failures

Function union_failures 

Source
pub fn union_failures(
    dst: &mut BTreeMap<PathBuf, FailureReason>,
    src: BTreeMap<PathBuf, FailureReason>,
)
Expand description

Fold src into dst, keeping the reason already present on a collision.

The one statement of the failure-union rule. It was written out longhand as entry().or_insert() at four sites - merge here plus three in the CLI - each with its own comment re-explaining it. The two analysis layers cover the same files, so the sets union rather than sum: one unreachable endpoint is one failure, not two. First-wins because the reasons cannot be meaningfully combined and the earlier layer saw the file first.