69 Commits

Author SHA1 Message Date
Aleksey Kladov 48bb35ccf1 publish 1.16.0-pre.1
This also reshuffles features a bit, to clearly separate public API from
internal features.
2022-10-22 19:25:26 +01:00
Markus Reiter 896a633afb Reenable some tests. 2022-10-06 03:48:58 +02:00
Markus Reiter a83d9a4dfc Change critical-section implementation to not use spin-lock. 2022-10-06 03:48:58 +02:00
Daniel Sanchez Quiros 60edfff216 Fix unnecesary mut 2022-09-02 07:41:19 +02:00
Daniel Sanchez Quiros 409d8cf705 Use force_mut return mut ref in test 2022-09-02 07:36:24 +02:00
Daniel Sanchez Quiros a30a9ba39e Formatting tests missing line 2022-09-02 07:25:34 +02:00
Daniel Sanchez Quiros 0e89764f0b Remove oncecell mut extensions tests 2022-09-02 07:22:18 +02:00
Daniel Sanchez Quiros f256970e67 Remove get_mut_unchecked 2022-09-02 07:18:16 +02:00
Daniel Sanchez Quiros a85dd873d5 Use &mut for get_mut_unchecked 2022-09-01 15:55:49 +02:00
Daniel Sanchez Quiros c31caa20db Added force_mut and get_mut tests to it.rs 2022-09-01 14:08:20 +02:00
Daniel Sanchez Quiros 16702d5bc6 Add OnceCell extension mut API tests to it.rs 2022-09-01 14:06:58 +02:00
Ralf Jung e8fb063271 reduce iteration counts for Miri 2022-06-26 15:31:23 -04:00
Ralf Jung d739fcc71c Miri has gained some more features 2022-06-26 15:25:46 -04:00
Aleksey Kladov 593978c9ee add OnceCell::wait
closes: #102
2022-05-20 16:13:15 +01:00
Aleksey Kladov c673f1240d fix deadlock
Kudos to @ekleog for finding it!
2022-05-19 16:15:10 +01:00
Benoît du Garreau 1e2e0d916b Add tests for OnceCell::with_value 2022-03-03 22:13:02 +01:00
Arnavion c090290ffe Fix race::OnceBox<T>: Default to not require T: Default 2021-03-01 23:04:00 -08:00
Aleksey Kladov 381692cc29 Release 1.7.0 2021-02-24 19:45:40 +03:00
William D. Jones d5e6a85759 Convert race to a default-enabled feature for targets without atomics. 2021-02-24 10:08:35 -05:00
Aleksey Kladov 6258aaf455 Add Lazy::into_value
This API allows to move a T out of `Lazy<T>`.
Note that it requires an owned access to a `Lazy` -- there's no way to
reset a lazy to uninit state via `&mut Lazy<T>`, as the init function
is gone. In other words, `fn take(this: &mut Lazy<T>)` is an
impossible object.
2021-02-22 13:28:42 +03:00
Aleksey Kladov 665987c1c3 publish v1.5.2 2020-11-12 13:43:38 +01:00
Aleksey Kladov 8a7202e70e Fix race set method 2020-11-11 11:02:01 +01:00
Aleksey Kladov 97260ee7d2 Reduce number of cfg for race 2020-11-11 11:02:01 +01:00
Cheng XU 5889de660b make once_cell::race::OnceBox available in alloc 2020-11-10 20:19:51 -08:00
Aleksey Kladov 46e6138a41 Add "first one wins" no_std-compatible flavor 2020-11-11 02:47:40 +01:00
Aleksey Kladov 4759a61755 Switch to xaction for CI 2020-11-11 01:38:33 +01:00
Ralf Jung 9bcc699b46 enable some thread-using tests on Miri 2020-08-19 11:47:23 +02:00
Aleksey Kladov f0104f088b Miri supports threads now 2020-08-19 10:34:19 +02:00
Aleksey Kladov 029de15a59 Make OnceCell pass drock
This fixes a regression from 1.3.1 to 1.4.0.

See
https://github.com/rust-lang/rust/pull/75555#issuecomment-675016718
and
https://doc.rust-lang.org/nomicon/dropck.html

Arrrrrrrrrrrrrrrrrrrrrr!
2020-08-17 22:46:27 +02:00
Ralf Jung 2ea432acdd miri: enable leakcheck 2020-04-07 23:23:12 +02:00
Aleksey Kladov 5f217006fb Implement DerefMut for Lazy 2020-01-14 18:28:10 +01:00
Ralf Jung 3cfbfb5905 Miri: ignore memory leaks so that we can test more things 2019-12-09 18:13:48 +01:00
Ralf Jung 4f89c55ddf Miri now supports panics 2019-12-07 13:04:23 +01:00
Aleksey Kladov 08afb5acb9 add test for reentrant initialization 2019-10-18 14:35:21 +03:00
Aleksey Kladov b28ef58bad add sync::OnceCell::get_unchecked
Note that we intentionally don't add
`unsync::OnceCell::get_unchecked`:

* it doesn't do any atomic operations, so should be cheap
* given than it's cheap, there's a chance that `get_unchecked` will be
  misused
* if you absolutely need it, you can `.unwrap_unchecked` on the call
  site
2019-09-14 18:16:20 +03:00
bors[bot] 700914e046 Merge #58
58: add OnceCell::get_mut r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-09-06 17:33:16 +00:00
Aleksey Kladov fc16befcf1 add OnceCell::get_mut 2019-09-06 20:32:06 +03:00
Alex Butler cb003f838a impl Default for Lazy 2019-09-02 14:06:08 +01:00
Aleksey Kladov 00dc3ca2a3 fix soundness hole in Lazy 2019-09-01 20:00:27 +03:00
Aleksey Kladov 8efea16fef reformat 2019-09-01 14:25:59 +03:00
Aleksey Kladov e1ea95b5db run threded tests without threads on miri 2019-09-01 14:25:01 +03:00
Aleksey Kladov 5da3d092af skip static lazy tests with miri 2019-09-01 14:10:41 +03:00
Aleksey Kladov 401c0916b8 cleanup miri tests 2019-09-01 14:04:07 +03:00
Aleksey Kladov 2277914f7c replace go with corssbeam::scope for testing 2019-09-01 14:02:43 +03:00
Aleksey Kladov 745ece5f04 run the whole test suite under miri 2019-09-01 13:57:49 +03:00
Aleksey Kladov e678db92c6 actually tests =/ 2019-09-01 13:42:43 +03:00
Aleksey Kladov 4734a9486b rearrange features
- drop unused pl
- introduce default std
- make parking_lot non-defalt
2019-08-26 23:40:03 +03:00
Aleksey Kladov f159517a5d add reentrancy tests 2019-08-23 00:32:08 +03:00
Aleksey Kladov d9782da1d7 implement get_or_try_init for std as well 2019-08-23 00:06:21 +03:00
Ozaren 16a36c2046 added test for sync::Lazy: Send + Sync 2019-08-07 13:27:27 -04:00