cargo-semver-checks 0.48.0

Scan your Rust crate for semver violations.
Documentation
SemverQuery(
    id: "function_export_name_changed",
    human_readable_name: "function's export name has changed or been removed",
    description: "A function's ABI name with #[no_mangle] or #[export_name = \"name\"] has changed or been removed",
    required_update: Major,
    lint_level: Deny,
    reference_link: Some("https://doc.rust-lang.org/reference/abi.html#the-no_mangle-attribute"),
    query: r#"
    {
        CrateDiff {
            baseline {
                item {
                    ... on Function {
                        importable_path {
                            path @output @tag
                            public_api @filter(op: "=", value: ["$true"])
                        }

                        export_name @output @tag @filter(op: "is_not_null")
                    }
                }
            }

            current {
                item {
                    ... on Function {
                        name @output

                        new_export_name: export_name @filter(op: "!=", value: ["%export_name"]) @output

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

                        span_: span @optional {
                            filename @output
                            begin_line @output
                            end_line @output
                        }
                    }
                }
            }
        }
    }"#,
    arguments: {
        "true": true,
    },
    error_message: "A function that was accessible both via the ABI and via the public API is no longer accessible via the same ABI symbol name. The behavior of the public API and ABI has diverged.",
    per_result_error_template: Some("function {{join \"::\" path}} no longer has ABI name {{export_name}} in {{span_filename}}:{{span_begin_line}}"),
)