diff options
| author | Martin Habovstiak <martin.habovstiak@gmail.com> | 2021-02-04 11:13:03 +0100 |
|---|---|---|
| committer | Martin Habovstiak <martin.habovstiak@gmail.com> | 2021-02-04 15:20:14 +0100 |
| commit | f42e96149dd03e816b8bc3c329e7b9a5d12fcdab (patch) | |
| tree | b9a550dae263d711255414fe996c09db8dc710f1 /library/std/src/sync/once | |
| parent | e708cbd91c9cae4426d69270248362b423324556 (diff) | |
| download | rust-f42e96149dd03e816b8bc3c329e7b9a5d12fcdab.tar.gz rust-f42e96149dd03e816b8bc3c329e7b9a5d12fcdab.zip | |
Stabilize poison API of Once, rename poisoned()
This stabilizes: * `OnceState` * `OnceState::is_poisoned()` (previously named `poisoned()`) * `Once::call_once_force()` `poisoned()` was renamed because the new name is more clear as a few people agreed and nobody objected. Closes #33577
Diffstat (limited to 'library/std/src/sync/once')
| -rw-r--r-- | library/std/src/sync/once/tests.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/sync/once/tests.rs b/library/std/src/sync/once/tests.rs index fae2752526e..0c35597e11c 100644 --- a/library/std/src/sync/once/tests.rs +++ b/library/std/src/sync/once/tests.rs @@ -69,7 +69,7 @@ fn poison_bad() { let mut called = false; O.call_once_force(|p| { called = true; - assert!(p.poisoned()) + assert!(p.is_poisoned()) }); assert!(called); @@ -92,7 +92,7 @@ fn wait_for_force_to_finish() { let (tx2, rx2) = channel(); let t1 = thread::spawn(move || { O.call_once_force(|p| { - assert!(p.poisoned()); + assert!(p.is_poisoned()); tx1.send(()).unwrap(); rx2.recv().unwrap(); }); |
