SemverQuery(
id: "repr_align_removed",
human_readable_name: "repr(align) removed",
description: "A struct, enum, or union that used to be #[repr(align(N))] is no longer #[repr(align)].",
required_update: Major,
lint_level: Deny,
reference_link: Some("https://doc.rust-lang.org/cargo/reference/semver.html#repr-align-remove"),
query: r#"
{
CrateDiff {
baseline {
item {
... on ImplOwner {
type: __typename @filter(op: "one_of", value: ["$types"]) @output @tag
visibility_limit @filter(op: "=", value: ["$public"])
attribute {
repr_align: raw_attribute @output
content {
base @filter(op: "=", value: ["$repr"])
argument {
base @filter(op: "=", value: ["$align"])
}
}
}
importable_path {
path @tag @output
public_api @filter(op: "=", value: ["$true"])
}
}
}
}
current {
item {
... on ImplOwner {
__typename @filter(op: "=", value: ["%type"])
visibility_limit @filter(op: "=", value: ["$public"])
name @output
attribute @fold @transform(op: "count") @filter(op: "=", value: ["$zero"]) {
content {
base @filter(op: "=", value: ["$repr"])
argument {
base @filter(op: "=", value: ["$align"])
}
}
}
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: {
"align": "align",
"public": "public",
"repr": "repr",
"true": true,
"types": ["Struct", "Enum", "Union"],
"zero": 0,
},
error_message: "A type no longer declares a minimum alignment via repr(align). This can break code that depends on the type's alignment or layout.",
per_result_error_template: Some("{{lowercase type}} {{name}} in {{span_filename}}:{{span_begin_line}}"),
)