Skip to content

Commit 60b2631

Browse files
committed
doc: add lint description
1 parent 0044776 commit 60b2631

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

bevy_lint/src/lints/style/bevy_platform_alternative_exists.rs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,60 @@
1+
//! Checks for types from `std` that have an equivalent in `bevy_platform`.
2+
//!
3+
//! # Motivation
4+
//!
5+
//! `bevy_platform` helps with platform compatibility support by providing drop in replacements for
6+
//! the following types:
7+
//!
8+
//! - Arc,
9+
//! - Barrier,
10+
//! - BarrierWaitResult,
11+
//! - HashMap,
12+
//! - HashSet,
13+
//! - Instant,
14+
//! - LazyLock,
15+
//! - LockResult,
16+
//! - Mutex,
17+
//! - MutexGuard,
18+
//! - Once,
19+
//! - OnceLock,
20+
//! - OnceState,
21+
//! - PoisonError,
22+
//! - RwLock,
23+
//! - RwLockReadGuard,
24+
//! - RwLockWriteGuard,
25+
//! - SyncCell,
26+
//! - SyncUnsafeCell,
27+
//! - TryLockError,
28+
//! - TryLockResult,
29+
//!
30+
//!
31+
//! # Known Issues
32+
//!
33+
//! This lint does not currently support checking partial imported definitions. For example:
34+
//!
35+
//! ```
36+
//! use std::time;
37+
//!
38+
//! let now = time::Instant::now();
39+
//! ```
40+
//!
41+
//! Will not emit a lint.
42+
//!
43+
//! # Example
44+
//!
45+
//! ```
46+
//! use std::time::Instant;
47+
//! let now = Instant::now();
48+
//! ```
49+
//!
50+
//! Use instead:
51+
//!
52+
//! ```
53+
//! use bevy::platform::time::Instant;
54+
//! let now = Instant::now();
55+
//! }
56+
//! ```
57+
158
use clippy_utils::{diagnostics::span_lint_and_sugg, is_from_proc_macro, source::snippet};
259
use rustc_errors::Applicability;
360
use rustc_hir::{

0 commit comments

Comments
 (0)