cargo-semver-checks 0.48.0

Scan your Rust crate for semver violations.
Documentation
SemverQuery(
    id: "function_changed_abi",
    human_readable_name: "pub function changed ABI",
    description: "A public function 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 {
                item {
                    ... on Function {
                        name @output
                        visibility_limit @filter(op: "=", value: ["$public"]) @output

                        importable_path {
                            path @output @tag
                            public_api @filter(op: "=", value: ["$true"])
                        }

                        abi_: abi {
                            name @output @tag
                            raw_name @output
                        }
                    }
                }
            }
            current {
                item {
                    ... on Function {
                        visibility_limit @filter(op: "=", value: ["$public"])

                        importable_path {
                            path @filter(op: "=", value: ["%path"])
                            public_api @filter(op: "=", value: ["$true"])
                        }

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

                        span_: span @optional {
                            filename @output
                            begin_line @output
                            end_line @output
                        }
                    }
                }
            }
        }
    }"#,
    arguments: {
        "public": "public",
        "true": true,
    },
    error_message: "A publicly-visible function changed its ABI.",
    per_result_error_template: Some("{{join \"::\" path}} changed ABI from {{abi_raw_name}} to {{new_abi_raw_name}} in {{span_filename}}:{{span_begin_line}}"),
    // Idea for what the witness looks like:
    // https://github.com/obi1kenobi/cargo-semver-checks/issues/1281
    witness: None,
)