java-topology/defects/rustc/patch/rustc-imports-fulfill-deeper-CLEAN.md

1.2 KiB

UNDF: UNDF-2026-000000267

rustc deeper scan — fulfill.rs CLEAN

Scan date: 2026-03-27 File scanned:

  • compiler/rustc_trait_selection/src/traits/fulfill.rs

Findings

fulfill.rs — CLEAN

FulfillProcessor::needs_process_obligation contains:

_ => (|| {
    for &infer_var in stalled_on {
        if self.selcx.infcx.ty_or_const_infer_var_changed(infer_var) {
            return true;
        }
    }
    false
})()

stalled_on is a Vec<TyOrConstInferVar> representing inference variables a single obligation is waiting on. This is a scan of one obligation's stall vars — not a scan of a global registry inside an outer loop over all obligations. The rustc team already documented and optimized this path (the comment notes it outperforms .any() for small vecs, and the common case of len == 1 is handled by a separate fast branch).

skippable_obligations uses take_while on a single stalled_on element — also intentionally bounded.

No CWE-407 defect.

Conclusion

fulfill.rs is CLEAN beyond previously patched defects. rustc-0004 (imports.rs ambiguity_errors Vec scan) remains the only new defect found in this deeper rustc scan.