summaryrefslogtreecommitdiff
path: root/clippy.toml
blob: 437f9e3b91b53f53a518038009fa2a7c77d5230d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
disallowed-types = [
    { path = "futures::channel::oneshot::Sender", reason = "Use tor_async_utils::oneshot to avoid bug with select macro" },
    { path = "futures::channel::oneshot::Receiver", reason = "Use tor_async_utils::oneshot to avoid bug with select macro" },
    { path = "futures::task::SpawnExt", reason = "use `tor_rtcompat::SpawnExt`, which is compatible with tokio-console" },
]
disallowed-methods = [
    { path = "rand::Rng::gen_range", reason = "Prefer tor_basic_utils::RngExt::gen_range_checked to avoid uncontrolled panics, or gen_range_infallible if applicable" },
    { path = "rand::Rng::random_range", reason = "Prefer tor_basic_utils::RngExt::gen_range_checked to avoid uncontrolled panics, or gen_range_infallible if applicable" },
    { path = "futures::channel::oneshot::channel", reason = "Use tor_async_utils::oneshot to avoid bug with select macro" },
    { path = "std::path::Path::display", reason = "See tor_basic_utils::PathExt::display_lossy" },
#    { path = "std::time::SystemTime::now", reason = "prefer using SleepProvider::wallclock instead when possible" },
    { path = "std::path::Path::exists", reason = "Prefer using std::Path::try_exists or std::fs::exists" },
    { path = "retry_error::RetryError::push", reason = "Use push_timed with mockable time sources instead of push which calls SystemTime::now" },
    { path = "retry_error::RetryError::extend", reason = "Use push_timed in a loop with mockable time sources instead of extend which calls push internally" },
    # This appears to be a fairly ugly bug, and since `weak_table` appears to be unmaintained, let's try to catch this early.
    { path = "weak_table::WeakHashSet::retain", reason = "`WeakHashSet::retain` is buggy; see https://github.com/tov/weak-table-rs/issues/22" },
    { path = "weak_table::PtrWeakHashSet::retain", reason = "`PtrWeakHashSet::retain` is buggy; see https://github.com/tov/weak-table-rs/issues/22" },
    { path = "weak_table::PtrWeakKeyHashMap::retain", reason = "`PtrWeakKeyHashMap::retain` is buggy; see https://github.com/tov/weak-table-rs/issues/22" },
    { path = "weak_table::PtrWeakWeakHashMap::retain", reason = "`PtrWeakWeakHashMap::retain` is buggy; see https://github.com/tov/weak-table-rs/issues/22" },
    { path = "weak_table::WeakKeyHashMap::retain", reason = "`WeakKeyHashMap::retain` is buggy; see https://github.com/tov/weak-table-rs/issues/22" },
    { path = "weak_table::WeakValueHashMap::retain", reason = "`WeakValueHashMap::retain` is buggy; see https://github.com/tov/weak-table-rs/issues/22" },
    { path = "weak_table::WeakWeakHashMap::retain", reason = "`WeakWeakHashMap::retain` is buggy; see https://github.com/tov/weak-table-rs/issues/22" },
]