cargo-semver-checks 0.48.0

Scan your Rust crate for semver violations.
Documentation
SemverQuery(
    id: "enum_marked_non_exhaustive",
    human_readable_name: "enum marked #[non_exhaustive]",
    description: "An exhaustive enum has been marked #[non_exhaustive].",
    reference: Some("An exhaustive enum has been marked #[non_exhaustive]. Pattern-matching on it outside of its crate must now include a wildcard pattern like `_`, or it will fail to compile."),
    required_update: Major,
    lint_level: Deny,
    reference_link: Some("https://doc.rust-lang.org/cargo/reference/semver.html#attr-adding-non-exhaustive"),
    query: r#"
    {
        CrateDiff {
            current {
                item {
                    ... on Enum {
                        visibility_limit @filter(op: "=", value: ["$public"]) @output
                        name @output

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

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

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

                        importable_path {
                            path @filter(op: "=", value: ["%path"])
                            public_api @filter(op: "=", value: ["$true"])
                        }
                    }
                }
            }
        }
    }"#,
    arguments: {
        "public": "public",
        "non_exhaustive": "#[non_exhaustive]",
        "true": true,
    },
    error_message: "A public enum has been marked #[non_exhaustive]. Pattern-matching on it outside of its crate must now include a wildcard pattern like `_`, or it will fail to compile.",
    per_result_error_template: Some("enum {{name}} in {{span_filename}}:{{span_begin_line}}"),
)