SemverQuery(
id: "inherent_method_no_longer_unwind",
human_readable_name: "inherent method ABI is no longer unwind-capable",
description: "A public inherent method changed from an unwind-capable ABI to the same ABI without unwind. Causing unwinding in that method (for example by panicking) is now undefined behavior for downstream callers.",
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 ImplOwner {
visibility_limit @filter(op: "=", value: ["$public"])
owner_type: __typename @tag @output
name @output
importable_path {
path @output @tag
public_api @filter(op: "=", value: ["$true"])
}
inherent_impl {
method {
visibility_limit @filter(op: "=", value: ["$public"])
method_name: name @output @tag
public_api_eligible @filter(op: "=", value: ["$true"])
new_abi_: abi {
name @tag(name: "abi_name")
raw_name @output
unwind @filter(op: "!=", value: ["$true"])
}
span_: span @optional {
filename @output
begin_line @output
end_line @output
}
}
}
}
}
}
baseline {
item {
... on ImplOwner {
__typename @filter(op: "=", value: ["%owner_type"])
visibility_limit @filter(op: "=", value: ["$public"])
importable_path {
path @filter(op: "=", value: ["%path"])
public_api @filter(op: "=", value: ["$true"])
}
inherent_impl {
method {
visibility_limit @filter(op: "=", value: ["$public"])
name @filter(op: "=", value: ["%method_name"])
public_api_eligible @filter(op: "=", value: ["$true"])
abi_: abi {
name @filter(op: "=", value: ["%abi_name"])
raw_name @output
unwind @filter(op: "=", value: ["$true"])
}
}
}
}
}
}
}
}"#,
arguments: {
"public": "public",
"true": true,
},
error_message: "A public inherent method lost its unwind-capable ABI. Any unwinding inside that method is now undefined behavior for downstream code.",
per_result_error_template: Some("{{join \"::\" path}}::{{method_name}} changed ABI from {{abi_raw_name}} to {{new_abi_raw_name}} in {{span_filename}}:{{span_begin_line}}"),
)