diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-06-19 00:17:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-19 00:17:13 +0200 |
| commit | 4737e9e42bdece36eed33fd9639195b60fdacd6f (patch) | |
| tree | db4050ede26c7c0eb52c2bd2f0dc1c607860388d /clippy_utils/src | |
| parent | 09c93018d77a19e3f8f6bde5dc70e929f04f6318 (diff) | |
| parent | f095f802dcd0f5ead14539c3f11985b4a3562912 (diff) | |
| download | rust-4737e9e42bdece36eed33fd9639195b60fdacd6f.tar.gz rust-4737e9e42bdece36eed33fd9639195b60fdacd6f.zip | |
Rollup merge of #98165 - WaffleLapkin:once_things_renamings, r=m-ou-se
once cell renamings
This PR does the renamings proposed in https://github.com/rust-lang/rust/issues/74465#issuecomment-1153703128
- Move/rename `lazy::{OnceCell, Lazy}` to `cell::{OnceCell, LazyCell}`
- Move/rename `lazy::{SyncOnceCell, SyncLazy}` to `sync::{OnceLock, LazyLock}`
(I used `Lazy...` instead of `...Lazy` as it seems to be more consistent, easier to pronounce, etc)
```@rustbot``` label +T-libs-api -T-libs
Diffstat (limited to 'clippy_utils/src')
| -rw-r--r-- | clippy_utils/src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs index 73c1bdd0e3f..5106c39b5c6 100644 --- a/clippy_utils/src/lib.rs +++ b/clippy_utils/src/lib.rs @@ -64,7 +64,7 @@ pub use self::hir_utils::{ use std::collections::hash_map::Entry; use std::hash::BuildHasherDefault; -use std::lazy::SyncOnceCell; +use std::sync::OnceLock; use std::sync::{Mutex, MutexGuard}; use if_chain::if_chain; @@ -2080,7 +2080,7 @@ pub fn is_hir_ty_cfg_dependant(cx: &LateContext<'_>, ty: &hir::Ty<'_>) -> bool { false } -static TEST_ITEM_NAMES_CACHE: SyncOnceCell<Mutex<FxHashMap<LocalDefId, Vec<Symbol>>>> = SyncOnceCell::new(); +static TEST_ITEM_NAMES_CACHE: OnceLock<Mutex<FxHashMap<LocalDefId, Vec<Symbol>>>> = OnceLock::new(); fn with_test_item_names<'tcx>(tcx: TyCtxt<'tcx>, module: LocalDefId, f: impl Fn(&[Symbol]) -> bool) -> bool { let cache = TEST_ITEM_NAMES_CACHE.get_or_init(|| Mutex::new(FxHashMap::default())); |
