Skip to main content

compute_diff_with_types

Function compute_diff_with_types 

Source
pub fn compute_diff_with_types(
    a: &BTreeMap<String, FnDecl>,
    b: &BTreeMap<String, FnDecl>,
    a_types: &BTreeMap<String, TypeDecl>,
    b_types: &BTreeMap<String, TypeDecl>,
    body_patches: bool,
) -> DiffReport
Expand description

Like compute_diff, but also diffs top-level type declarations, emitting added / removed / modified entries for them so diff_to_ops produces AddType / RemoveType / ModifyType ops. A type’s signature is rendered type Name = … (the "type " prefix is how diff_to_ops tells a type removal from a function removal), and its old_sig_id is the SigId of the old TypeDecl stage. Rename detection is intentionally function-only; a renamed type reads as a remove + add, which reproduces it correctly.