SemverQuery(
id: "repr_c_removed",
human_readable_name: "repr(C) removed",
description: "A type that used to be repr(C) is no longer repr(C).",
reference: Some("A type that used to be repr(C) is no longer repr(C). This can cause its memory layout to change, breaking FFI use cases."),
required_update: Major,
reference_link: Some("https://doc.rust-lang.org/cargo/reference/semver.html#repr-c-remove"),
query: r#"
{
CrateDiff {
baseline {
item {
... on ImplOwner {
owner_type: __typename @tag @output
visibility_limit @filter(op: "=", value: ["$public"]) @output
attribute {
old_attr: raw_attribute @output
content {
base @filter(op: "=", value: ["$repr"])
argument {
base @filter(op: "=", value: ["$c"])
}
}
}
importable_path {
path @tag @output
public_api @filter(op: "=", value: ["$true"])
}
}
}
}
current {
item {
... on ImplOwner {
__typename @filter(op: "=", value: ["%owner_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: ["$c"])
}
}
}
importable_path {
path @filter(op: "=", value: ["%path"])
public_api @filter(op: "=", value: ["$true"])
}
span_: span @optional {
filename @output
begin_line @output
}
}
}
}
}
}"#,
arguments: {
"public": "public",
"repr": "repr",
"c": "C",
"true": true,
"zero": 0,
},
error_message: "repr(C) was removed from a type. This can cause its memory layout to change, breaking FFI use cases.",
per_result_error_template: Some("{{lowercase owner_type}} {{name}} in {{span_filename}}:{{span_begin_line}}"),
)