SemverQuery(
id: "function_abi_no_longer_unwind",
human_readable_name: "function abi no longer unwind",
description: "A pub fn changed from an unwind-capable ABI to the same-named ABI without unwind. If that function causes an unwind (e.g. by panicking), its behavior is now undefined.",
required_update: Major,
lint_level: Deny,
reference_link: Some("https://rust-lang.github.io/rfcs/2945-c-unwind-abi.html"),
query: r#"
{
CrateDiff {
current {
item {
... on Function {
visibility_limit @filter(op: "=", value: ["$public"])
name @output
new_abi_: abi {
name @tag(name: "abi")
raw_name @output
unwind @filter(op: "!=", value: ["$true"])
}
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 Function {
visibility_limit @filter(op: "=", value: ["$public"])
abi_: abi {
name @filter(op: "=", value: ["%abi"])
raw_name @output
unwind @filter(op: "=", value: ["$true"])
}
importable_path {
path @filter(op: "=", value: ["%path"])
public_api @filter(op: "=", value: ["$true"])
}
}
}
}
}
}"#,
arguments: {
"public": "public",
"true": true,
},
error_message: "A pub fn changed from an unwind-capable ABI to the same-named ABI without unwind. If that function causes an unwind (e.g. by panicking), its behavior is now undefined.",
per_result_error_template: Some("{{name}} changed ABI from {{abi_raw_name}} to {{new_abi_raw_name}} in {{span_filename}}:{{span_begin_line}}"),
)