cargo-semver-checks 0.8.0

Scan your Rust crate for semver violations.
SemverQuery(
    id: "struct_pub_field_missing",
    human_readable_name: "pub struct's pub field removed or renamed",
    description: "A publicly-visible struct has at least one public field that is no longer available under its prior name, which is a major breaking change for code that depends on it.",
    required_update: Major,
    reference_link: Some("https://doc.rust-lang.org/cargo/reference/semver.html#item-remove"),
    query: r#"
    {
        CrateDiff {
            baseline {
                item {
                    ... on Struct {
                        visibility_limit @filter(op: "=", value: ["$public"])
                        struct_name: name @output @tag
                        struct_type @output @tag

                        importable_path {
                            path @output @tag
                        }

                        field {
                            field_name: name @output @tag
                            visibility_limit @filter(op: "=", value: ["$public"])

                            span_: span @optional {
                                filename @output
                                begin_line @output
                            }
                        }
                    }
                }
            }
            current {
                item {
                    ... on Struct {
                        visibility_limit @filter(op: "=", value: ["$public"])
                        name @filter(op: "=", value: ["%struct_name"])
                        struct_type @filter(op: "=", value: ["%struct_type"])

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

                        field @fold @transform(op: "count") @filter(op: "=", value: ["$zero"]) {
                            name @filter(op: "=", value: ["%field_name"])
                            visibility_limit @filter(op: "=", value: ["$public"])
                        }
                    }
                }
            }
        }
    }"#,
    arguments: {
        "public": "public",
        "zero": 0,
    },
    error_message: "A publicly-visible struct has at least one public field that is no longer available under its prior name. It may have been renamed or removed entirely.",
    per_result_error_template: Some("field {{field_name}} of struct {{struct_name}}, previously in file {{span_filename}}:{{span_begin_line}}"),
)