cargo-semver-checks 0.48.0

Scan your Rust crate for semver violations.
Documentation
SemverQuery(
    id: "enum_no_longer_non_exhaustive",
    human_readable_name: "enum no longer #[non_exhaustive]",
    description: "A pub enum is no longer #[non_exhaustive]. Pattern-matching outside its crate is now exhaustive, potentially causing breaking changes if new variants are added.",
    required_update: Minor,
    lint_level: Allow,
    reference_link: Some("https://doc.rust-lang.org/reference/attributes/type_system.html#the-non_exhaustive-attribute"),
    query: r#"
    {
        CrateDiff {
            current {
                item {
                    ... on Enum {
                        visibility_limit @filter(op: "=", value: ["$public"]) @output
                        name @output

                        attrs @filter(op: "not_contains", value: ["$non_exhaustive"])

                        importable_path {
                            path @output @tag
                        }

                        span_: span @optional {
                            filename @output
                            begin_line @output
                        }
                    }
                }
            }
            baseline {
                item {
                    ... on Enum {
                        visibility_limit @filter(op: "=", value: ["$public"])
                        attrs @filter(op: "contains", value: ["$non_exhaustive"])

                        importable_path {
                            path @filter(op: "=", value: ["%path"])
                        }
                    }
                }
            }
        }
    }"#,
    arguments: {
        "public": "public",
        "non_exhaustive": "#[non_exhaustive]",
    },
    error_message: "A pub enum is no longer #[non_exhaustive]. Pattern-matching outside its crate is now exhaustive, potentially causing breaking changes if new variants are added.",
    per_result_error_template: Some("enum {{name}} in {{span_filename}}:{{span_begin_line}}"),
)