diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-06-16 19:41:40 +0400 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-06-16 19:53:59 +0400 |
| commit | 7c360dc117d554a11f7193505da0835c4b890c6f (patch) | |
| tree | 214c085729d9636756ebc16e0f6b17e1b5802629 /library/std/src/lazy/tests.rs | |
| parent | 392d2728683f140f6125732240e462c43c5caff4 (diff) | |
| download | rust-7c360dc117d554a11f7193505da0835c4b890c6f.tar.gz rust-7c360dc117d554a11f7193505da0835c4b890c6f.zip | |
Move/rename `lazy::{OnceCell, Lazy}` to `cell::{OnceCell, LazyCell}`
Diffstat (limited to 'library/std/src/lazy/tests.rs')
| -rw-r--r-- | library/std/src/lazy/tests.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/library/std/src/lazy/tests.rs b/library/std/src/lazy/tests.rs index 83466eb0904..66d6236c111 100644 --- a/library/std/src/lazy/tests.rs +++ b/library/std/src/lazy/tests.rs @@ -1,5 +1,6 @@ use crate::{ - lazy::{Lazy, SyncLazy, SyncOnceCell}, + cell::LazyCell, + lazy::{SyncLazy, SyncOnceCell}, panic, sync::{ atomic::{AtomicUsize, Ordering::SeqCst}, @@ -21,7 +22,7 @@ fn lazy_default() { } } - let lazy: Lazy<Mutex<Foo>> = <_>::default(); + let lazy: LazyCell<Mutex<Foo>> = <_>::default(); assert_eq!(CALLED.load(SeqCst), 0); @@ -36,7 +37,7 @@ fn lazy_default() { #[test] fn lazy_poisoning() { - let x: Lazy<String> = Lazy::new(|| panic!("kaboom")); + let x: LazyCell<String> = LazyCell::new(|| panic!("kaboom")); for _ in 0..2 { let res = panic::catch_unwind(panic::AssertUnwindSafe(|| x.len())); assert!(res.is_err()); |
