Repository navigation
Expand file tree
/
Copy pathclippy.toml
More file actions
44 lines (40 loc) · 3.16 KB
/
Copy pathclippy.toml
File metadata and controls
44 lines (40 loc) · 3.16 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
# Iterating a hash collection visits entries in an order that changes from one
# run to the next, so a simulated session would not replay. Use a BTreeMap or
# BTreeSet, or `#[expect]` with the reason order cannot matter. The
# `iter_over_hash_type` lint covers `for` loops.
disallowed-methods = [
{ path = "std::collections::HashMap::drain", reason = "iteration order varies between runs" },
{ path = "std::collections::HashMap::into_keys", reason = "iteration order varies between runs" },
{ path = "std::collections::HashMap::into_values", reason = "iteration order varies between runs" },
{ path = "std::collections::HashMap::iter", reason = "iteration order varies between runs" },
{ path = "std::collections::HashMap::iter_mut", reason = "iteration order varies between runs" },
{ path = "std::collections::HashMap::keys", reason = "iteration order varies between runs" },
{ path = "std::collections::HashMap::values", reason = "iteration order varies between runs" },
{ path = "std::collections::HashMap::values_mut", reason = "iteration order varies between runs" },
{ path = "std::collections::HashSet::difference", reason = "iteration order varies between runs" },
{ path = "std::collections::HashSet::drain", reason = "iteration order varies between runs" },
{ path = "std::collections::HashSet::intersection", reason = "iteration order varies between runs" },
{ path = "std::collections::HashSet::iter", reason = "iteration order varies between runs" },
{ path = "std::collections::HashSet::symmetric_difference", reason = "iteration order varies between runs" },
{ path = "std::collections::HashSet::union", reason = "iteration order varies between runs" },
# Aborting a task cancels it at whichever await it reached, which leaves
# anything it was changing half done; see "Cancellation" in
# dev/architecture.md. Ask the task to stop instead, or `#[expect]` with
# the reason nothing it can be doing matters once it stops.
{ path = "tokio::task::JoinHandle::abort", reason = "cancels the task at any await; ask it to stop" },
{ path = "tokio::task::AbortHandle::abort", reason = "cancels the task at any await; ask it to stop" },
{ path = "tokio::task::JoinSet::abort_all", reason = "cancels the tasks at any await; ask them to stop" },
{ path = "tokio::task::JoinSet::shutdown", reason = "cancels the tasks at any await; ask them to stop" },
# Each call listens anew, so a signal that comes between two is lost.
{ path = "tokio::signal::ctrl_c", reason = "misses a Ctrl-C between calls; hold one tokio::signal::unix::signal" },
]
# A future dropped while it holds a tokio lock releases it with whatever it
# changed half done, and the next holder sees that. Keep data under a
# std::sync::Mutex, never held across an await, or give a resource to a
# task of its own; see "Cancellation" in dev/architecture.md.
disallowed-types = [
{ path = "tokio::sync::Mutex", reason = "a cancelled holder releases it mid-change; see dev/architecture.md" },
{ path = "tokio::sync::RwLock", reason = "a cancelled holder releases it mid-change; see dev/architecture.md" },
]
# Names documentation spells as prose; ".." keeps Clippy's own list.
doc-valid-idents = ["CPython", ".."]