-
-
Notifications
You must be signed in to change notification settings - Fork 75
/
trait_method_unsafe_removed.ron
61 lines (56 loc) · 2.33 KB
/
trait_method_unsafe_removed.ron
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
SemverQuery(
id: "trait_method_unsafe_removed",
human_readable_name: "pub trait method became safe",
description: "A method in a public trait became safe",
required_update: Major,
lint_level: Deny,
reference_link: Some("https://doc.rust-lang.org/stable/reference/unsafe-keyword.html#unsafe-functions-unsafe-fn"),
query: r#"
{
CrateDiff {
baseline {
item {
... on Trait {
visibility_limit @filter(op: "=", value: ["$public"]) @output
sealed @filter(op: "!=", value: ["$true"])
importable_path {
path @output @tag
public_api @filter(op: "=", value: ["$true"])
}
method {
unsafe @filter(op: "=", value: ["$true"])
public_api_eligible @filter(op: "=", value: ["$true"])
method_name: name @output @tag
}
}
}
}
current {
item {
... on Trait {
visibility_limit @filter(op: "=", value: ["$public"])
importable_path {
path @filter(op: "=", value: ["%path"])
public_api @filter(op: "=", value: ["$true"])
}
method {
unsafe @filter(op: "!=", value: ["$true"])
public_api_eligible @filter(op: "=", value: ["$true"])
name @filter(op: "=", value: ["%method_name"])
span_: span @optional {
filename @output
begin_line @output
}
}
}
}
}
}
}"#,
arguments: {
"true": true,
"public": "public",
},
error_message: "A publicly-visible trait method is no longer `unsafe`, so implementations must remove the `unsafe` qualifier.",
per_result_error_template: Some("trait method <{{join \"::\" path}}>::{{method_name}} in file {{span_filename}}:{{span_begin_line}}"),
)