cargo-semver-checks 0.48.0

Scan your Rust crate for semver violations.
Documentation
SemverQuery(
    id: "trait_method_receiver_added",
    human_readable_name: "trait method receiver added",
    description: "A method in an unsealed pub trait gained a receiver.",
    required_update: Major,
    lint_level: Deny,
    reference_link: Some("https://doc.rust-lang.org/cargo/reference/semver.html#trait-item-signature"),
    query: r#"
    {
        CrateDiff {
            baseline {
                item {
                    ... on Trait {
                        visibility_limit @filter(op: "=", value: ["$public"]) @output
                        public_api_sealed @filter(op: "!=", value: ["$true"])
                        unconditionally_sealed @filter(op: "!=", value: ["$true"])

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

                        method {
                            method_name: name @output @tag
                            public_api_eligible @filter(op: "=", value: ["$true"])

                            receiver @fold @transform(op: "count") @filter(op: "=", value: ["$zero"])
                        }
                    }
                }
            }
            current {
                item {
                    ... on Trait {
                        visibility_limit @filter(op: "=", value: ["$public"])

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

                        method {
                            name @filter(op: "=", value: ["%method_name"])
                            public_api_eligible @filter(op: "=", value: ["$true"])

                            current_receiver_: receiver {
                                by_reference @output
                                by_mut_reference @output
                                by_value @output
                                kind @output
                            }

                            span_: span @optional {
                                filename @output
                                begin_line @output
                                end_line @output
                            }
                        }
                    }
                }
            }
        }
    }"#,
    arguments: {
        "public": "public",
        "true": true,
        "zero": 0,
    },
    error_message: "A trait method in an unsealed trait added a receiver, breaking downstream implementations.",
    per_result_error_template: Some("{{join \"::\" path}}::{{method_name}} now takes {{#if current_receiver_by_reference }}&{{/if}}{{#if current_receiver_by_mut_reference }}&mut {{/if}}{{current_receiver_kind}}, in {{span_filename}}:{{span_begin_line}}"),
    witness: None,
)