-
-
Notifications
You must be signed in to change notification settings - Fork 130
Expand file tree
/
Copy pathfunction_changed_abi.ron
More file actions
63 lines (58 loc) · 2.18 KB
/
function_changed_abi.ron
File metadata and controls
63 lines (58 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
SemverQuery(
id: "function_changed_abi",
human_readable_name: "pub function changed ABI",
description: "A public function changed its external ABI.",
required_update: Major,
lint_level: Deny,
reference_link: Some("https://doc.rust-lang.org/reference/items/external-blocks.html#abi"),
query: r#"
{
CrateDiff {
baseline {
item {
... on Function {
name @output
visibility_limit @filter(op: "=", value: ["$public"]) @output
importable_path {
path @output @tag
public_api @filter(op: "=", value: ["$true"])
}
abi_: abi {
name @output @tag
raw_name @output
}
}
}
}
current {
item {
... on Function {
visibility_limit @filter(op: "=", value: ["$public"])
importable_path {
path @filter(op: "=", value: ["%path"])
public_api @filter(op: "=", value: ["$true"])
}
new_abi_: abi {
name @filter(op: "!=", value: ["%name"]) @output
raw_name @output
}
span_: span @optional {
filename @output
begin_line @output
end_line @output
}
}
}
}
}
}"#,
arguments: {
"public": "public",
"true": true,
},
error_message: "A publicly-visible function changed its ABI.",
per_result_error_template: Some("{{join \"::\" path}} changed ABI from {{abi_raw_name}} to {{new_abi_raw_name}} in {{span_filename}}:{{span_begin_line}}"),
// Idea for what the witness looks like:
// https://github.com/obi1kenobi/cargo-semver-checks/issues/1281
witness: None,
)