File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed
bevy_lint/src/lints/style Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change 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+
158use clippy_utils:: { diagnostics:: span_lint_and_sugg, is_from_proc_macro, source:: snippet} ;
259use rustc_errors:: Applicability ;
360use rustc_hir:: {
You can’t perform that action at this time.
0 commit comments