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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
[]
= "clone-behavior"
= ["Finley Huggins"]
= "Bound the semantic behavior and time complexity of cloning a value"
= "README.md"
= ["clone", "time", "aliasing", "refcount"]
= ["rust-patterns", "memory-management", "no-std", "no-std::no-alloc"]
= ["Cargo.toml", "src/**/*.rs", "LICENSE-APACHE", "LICENSE-MIT", "README.md"]
= "0.2.0"
= "2024"
= "1.85"
= "https://github.com/robofinch/clone-behavior"
= "MIT OR Apache-2.0"
[]
[]
= ["std"]
= ["alloc"]
= []
# Out of the lints that do anything (non-deprecated clippy lints, non-migration rust lints),
# AFAICT there are 36 left at the "allow" level :)
[]
# Note: I basically went through every allow-by-default lint, and am linting against
# almost everything, except lints just related to migrating to Edition 2018, 2021, or 2024;
# since this codebase is in Edition 2024, those lints don't have any use here.
= "warn"
= "warn"
= "warn"
= "warn"
= "warn"
= "warn"
= "warn"
= "warn"
= "warn"
= "warn"
# Note: this lint may have false positives.
= "warn"
# Note: may be a noisy lint, but explicitly disabling it when necessary should be less error-prone
# than remembering to derive Copy in almost all applicable cases
= "warn"
= "warn"
= "warn"
= "warn"
= "warn"
= "warn"
# The below lint seems like it might still be worth enabling in Edition 2024; idk, default to "sure"
= "warn"
# Note: this lint may have false positives.
= "warn"
= "warn"
= "warn"
= "warn"
= "warn"
= "warn"
= "warn"
# Any module with unsafe code should do `#![expect(unsafe_code)]` at the top,
# in an effort to make it easier to know at a glance whether a module uses `unsafe`.
= "warn"
# Will likely become a compile error at some point anyway
= "warn"
# Note: this lint could have false positives in a package with multiple crates.
# Here, the packages have one crate each, so it's fine.
= "warn"
= "warn"
= "warn"
= "warn"
= "warn"
= "warn"
= "warn"
= "warn"
= { = "warn", = -1 }
= { = "warn", = -1 }
# Currently, every lint in the `nonstandard_style` group is actually warn-by-default already.
= { = "warn", = -1 }
# Note that the `unused_results` lint is intentionally left as `allow`
# `linker-messages` is left as `allow` in absence of a reason to worry about the linker
# I would enable the following lints if possible, but they're unstable as of early 2026:
# - fuzzy_provenance_casts
# - lossy_provenance_casts
# - multiple_supertrait_upcastable
# - must_not_suspend
# - non_exhaustive_omitted_patterns
# - resolving_to_items_shadowing_supertrait_items
# - shadowing_supertrait_items
# - unqualified_local_imports
# `just clippy` will use the above lints on the nightly channel.
[]
# Note: the strategy here, unlike with rust lints, is to just enable everything, and carve out
# exceptions as needed.
# See clippy.toml as well.
# Defaults
= { = "deny", = -1 }
= { = "warn", = -1 }
= { = "warn", = -1 }
= { = "warn", = -1 }
= { = "warn", = -1 }
# The rest
= { = "warn", = -1 }
= { = "warn", = -1 }
= { = "warn", = -1 }
= { = "warn", = -1 }
= "allow"
# Correctness exceptions: there are none.
# Suspicious exceptions
# Yes, it's normally an awful idea to blanket-enable the `restriction` group,
# but it's easier to be warned about a dumb lint and disable it below
# than to figure out in advance which ones deserve to be enabled.
= "allow"
# Style exceptions
# `parse` seems too opaque, the meaning of the `from_str_radix` method is immediately clear.
= "allow"
# I think `(3..8).contains(x)` looks worse than `3 <= x && x < 8`.
= "allow"
# Sometimes I like to be more explicit.
= "allow"
# Complexity exceptions
# Sometimes helpful with rust-analyzer to not have a super-long type hint.
= "allow"
# Pedantic exceptions
# `map(..).unwrap_or(..)` is, I think, more readable than `map_or(.., ..)`.
= "allow"
= "allow"
# Restriction exceptions
# `#[allow]` attributes should be used sparingly, but it's more convenient to simply be able
# to use them when necessary, without extra shenanigans.
# `just find_allow_attributes` can show where any `[allow(` string is, to find the attributes.
= "allow"
= "allow"
= "allow"
# A good lint, but the various "*_fs" modules in anchored-vfs have so many similar structs,
# no point in adding weird acronym prefixes instead of leaving them namespaced.
= "allow"
# Most enums and structs don't need to be #[non_exhaustive] for the sake of semver.
= "allow"
= "allow"
# Similar to map_unwrap_or and whatnot
= "allow"
= "allow"
= "allow"
= "allow"
= "allow"
= "allow"
= "allow"
# The extra verbosity seems unnecessary
= "allow"
= "allow"
= "allow"
= "allow"
= "allow"
= "allow"
= "allow"
= "allow"
= "allow"
# This is covered by the `unwrap_used` lint, and seems to be more annoying to `#[expect]`.
= "allow"
# Nursery exceptions
# I find `if let` and `else` to look much better than `map_or_else`.
= "allow"
# Doesn't really help much, and `#[expect]`ing it is a hassle. Might be good to run the lint
# once in a while, though.
= "allow"
[]
= { = "warn", = -1 }