cargo-semver-checks 0.48.0

Scan your Rust crate for semver violations.
Documentation
SemverQuery(
    id: "exported_function_changed_abi",
    human_readable_name: "exported function changed ABI",
    description: "A function marked `#[no_mangle]` or assigned an explicit `#[export_name]` changed its external ABI.",
    required_update: Major,
    lint_level: Deny,
    reference_link: Some("https://doc.rust-lang.org/reference/items/external-blocks.html#abi"),
    query: r#"{
    CrateDiff {
        baseline {
            ffi_exported_function {
                export_name @filter(op: "is_not_null") @tag

                abi_: abi {
                    name @tag @output
                    raw_name @output
                }
            }
        }
        current {
            ffi_exported_function {
                name @output
                export_name @filter(op: "=", value: ["%export_name"]) @output

                new_abi_: abi {
                    name @filter(op: "!=", value: ["%name"]) @output
                    raw_name @output
                }

                span_: span @optional {
                    filename @output
                    begin_line @output
                    end_line @output
                }
            }
        }
    }
}"#,
    arguments: {
        // No arguments!
    },
    error_message: "A function with an export_name has changed ABI.",
    per_result_error_template: Some("{{name}} exported as {{export_name}} changed from {{abi_raw_name}} to {{new_abi_raw_name}} in {{span_filename}}:{{span_begin_line}}"),
)