243 Commits

Author SHA1 Message Date
Artyom Pavlov
695fc9a5f5
Fix new Clippy lints (#1511) 2024-10-16 02:54:28 +03:00
Diggory Hardy
f5185d91fa
thread_rng() → rand::rng() (#1506)
- Rename `rand::thread_rng()` → `rand::rng()`
- Remove `thread_rng()` and `random()` from the prelude
2024-10-11 08:51:21 +01:00
Artyom Pavlov
0fba9401c4
rand_core: add blanket impl of TryRngCore for RngCore (#1499)
This PR removes the hacky `impl_try_rng_from_rng_core` and
`impl_try_crypto_rng_from_crypto_rng` macros and replaces them with
blanket impls of `TryRngCore` for `RngCore` and `TryCryptoRng` for
`CryptoRng`.

This change means that `TryRngCore`/`TryCryptoRng` no longer can have
blanket impls for `&mut R` and `Box<R>`. But I think it should be
tolerable since most users will be using `RngCore`/`CryptoRng`, which
have blanket impl for `DerefMut` (it covers both `&mut R` and `Box<R>`).
2024-10-09 13:27:07 +03:00
Joshua Liebow-Feeser
d2eb51bc29
Remove some unsafe, update to zerocopy 0.8.0 (#1502) 2024-10-07 09:29:52 +01:00
Diggory Hardy
66b11eb17b
Rename gen_iter → random_iter, misc.. (#1500)
This extracts the non-inherent-methods stuff from #1492.
2024-10-01 14:59:11 +01:00
Clar Fon
71c53be9a9
Require SeedableRng::Seed to impl Clone + AsRef (#1491) 2024-09-09 08:10:01 +01:00
Bruce Mitchener
f7bbccaedf
Rename serde1 feature to serde. (#1477) 2024-07-26 08:48:53 +01:00
Bruce Mitchener
f3aab23fba
Fix clippy::doc_markdown warnings. (#1474) 2024-07-20 09:56:27 +01:00
Bruce Mitchener
e4874a6dd7
Fix some typos. (#1472) 2024-07-20 09:42:52 +01:00
Artyom Pavlov
890ad8b68b
Rename doc_cfg to docsrs and use doc_auto_cfg (#1450) 2024-05-10 13:46:26 +03:00
Artyom Pavlov
1b762b2867
Apply rustfmt and fix Clippy warnings (#1448) 2024-05-09 07:50:08 +01:00
Joe Richey
e93776960e
Update Panic documentation and #[track_caller] (#1447)
This is stuff I missed in #1442

Signed-off-by: Joe Richey <joerichey@google.com>
Co-authored-by: Diggory Hardy <git@dhardy.name>
2024-05-08 14:30:08 +01:00
Artyom Pavlov
fba5521f0f
Add TryRngCore and TryCryptoRng traits (#1424)
This reworks fallibility, replacing the fixed `Error` type.
2024-05-08 14:10:32 +01:00
Joshua Liebow-Feeser
1f818787ca
Use zerocopy 0.7.33, not 0.8.0-alpha (#1446) 2024-05-07 04:38:30 -07:00
Joe Richey
a2375dceaf
Add #[track_caller] to methods which panic (#1442)
* Add #[track_caller] to methods which panic

This makes it easier to diagnose problems when the preconidtions of
these methods are not met.

Signed-off-by: Joe Richey <joerichey@google.com>
2024-05-05 08:19:29 +01:00
Diggory Hardy
0e626c7436
Cleaner README, remove MSRV shields (#1417) 2024-03-25 14:56:17 +00:00
Diggory Hardy
2eaf8545d4
Bump the MSRV to 1.61.0 (#1416) 2024-03-22 12:33:33 +00:00
Diggory Hardy
1015e709da
Prepare 0.9.0-alpha.1 (#1413) 2024-03-18 19:08:37 +00:00
dependabot[bot]
be75bf5b90
Update zerocopy requirement from =0.8.0-alpha.5 to =0.8.0-alpha.6 (#1401) 2024-03-18 09:27:47 +00:00
TheIronBorn
769bcb6e4c
Document more crate feature usage (#1411) 2024-03-18 08:42:42 +00:00
Michael Dyer
304048bdd9
Fix redundant import warnings (#1405) 2024-03-07 08:34:53 +00:00
Diggory Hardy
5577003615
Update CHANGELOGs and prepare rand 0.9.0-alpha.0 (#1395)
Also: add pull-request template
2024-02-18 17:02:05 +00:00
Diggory Hardy
e5a366d07f
Update zerocopy; trim unused methods (#1393)
* Remove mention of stdsimd
* Move fns FloatSIMDUtils::replace, extract to new cfg-gated trait FloatSIMDScalarUtils
* Remove unused utility methods on floats, bool
* Remove unused import
* Update to zerocopy 0.8.0-alpha.5
* Remove unneeded import of Float
2024-02-13 11:13:57 +00:00
bjorn3
1f4507a8e1
Allow new warning on recent nightly versions (#1376) 2024-01-26 15:15:32 +00:00
Diggory Hardy
1db3aa416c
Replace SeedableRng impl for SmallRng with inherent fns (#1368)
* Simplify redundant doc-link

* Remove impl of SeedableRng for SmallRng

* Fix SeedableRng::Seed type for StdRng

* SmallRng: do not expect thread_rng

* Make SmallRng::from_thread_rng infallible

* Fix benchmarks (SmallRng does not have from_entropy)
2024-01-05 10:58:22 +00:00
Vinzent Steinberg
c427cff1d5 Fix clippy warnings 2023-12-14 08:50:57 +01:00
Alex Saveau
ef89cbefaf
Support using std without getrandom or rand_chacha (#1354)
Support using std without getrandom or rand_chacha

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2023-11-06 08:15:07 +00:00
Joshua Liebow-Feeser
5216f9a7fc Remove some unsafe code 2023-10-29 16:07:50 -04:00
bjorn3
e42c385872
MSRV=1.60, use more permissive cfg on test
* Use cfg(panic = unwind) instead of a check for wasm32 to see if unwinding is supported

This allows the test to run on a future wasm target with exception support as
well as running the test suite with panic=abort on non-wasm targets.

* Bump MSRV to 1.60
2023-10-11 08:54:54 +01:00
Guillaume Gomez
176e73647a
Add --generate-link-to-definition option when building on docs.rs (#1327)
* Add `--generate-link-to-definition` option when building on docs.rs

* Fix documentation issues
2023-07-29 08:12:57 +01:00
Alex Saveau
17c8b2625c
Don't run the random write test (#1294) 2023-02-27 08:07:03 +00:00
Artyom Pavlov
7c1e649ea1
Rework CryptoRng (#1273) 2023-02-20 10:28:23 +00:00
Alex Saveau
0dddc2c559
Add read_adapter to avoid dynamic dispatch (#1267)
* Add read_adapter to avoid dynamic dispatch

* Get rid of the dyn Read impl since we can't deprecate it
2022-12-07 10:18:04 +00:00
Diggory Hardy
50b9a44741
fill_via_chunks: mutate src on BE (small optimisation) (#1182)
* fill_via_chunks: mutate src on BE (small optimisation)

* Add doc to fill_via_chunks
2022-12-07 09:47:45 +00:00
Diggory Hardy
19169cbce9
Bump MSRV to 1.56 (Edition 2021) (#1269)
* Bump MSRV to 1.56 (Edition 2021)

* Apply Clippy suggestions

* Bump edition and add rust-version field to Cargo.toml

* CI AVR test: unpin nightly rust version

* Disable AVR test

* Bump crate version numbers for a breaking release
2022-12-06 19:01:10 +00:00
Frank Steffahn
21131af61d
Remove redundant AsRef/AsMut bounds (#1207) 2022-11-14 11:37:49 +00:00
Diggory Hardy
9720f110a6
Update GitHub Actions (#1263)
* examples/rayon-monte-carlo.rs: remove execute bit of file metadata

* Document in README that MSRV is 1.51.0

This was changed in #1246

* Update GitHub Actions
2022-11-10 15:36:40 +00:00
Diggory Hardy
766c7eccd7
Doc: improve random, thread_rng, ThreadRng docs (#1257)
* Use a custom Debug impl for ThreadRng

* Adjust documentation of random, thread_rng, ThreadRng

* Fix no-std build

* Compatibility with older rustc
2022-09-30 09:48:10 +01:00
Alex Touchet
2b4f00add7
Update listed rand_core version number (#1254) 2022-09-16 07:41:28 +01:00
Diggory Hardy
89a1336b93
rand_core: update CHANGELOG for 0.6.4 (#1253) 2022-09-15 14:23:08 +01:00
Chris Beck
3543f4b025
Make CryptoRngCore trait imply CryptoRng as well (#1230) 2022-05-19 17:55:31 +01:00
Vinzent Steinberg
c1e859f818 Avoid unnecessary by_ref 2021-10-21 20:35:33 +02:00
Vinzent Steinberg
bd0038d767 Fix clippy warnings 2021-10-21 16:23:14 +02:00
Vinzent Steinberg
a4fa0771a2 CryptoRngCore: Improve docs 2021-09-20 14:27:14 +02:00
Vinzent Steinberg
c797f070b1 rand_core: Rename CryptoRngCore::upcast to as_rngcore 2021-09-20 14:10:39 +02:00
Vinzent Steinberg
51d1365370 rand_core: Add CryptoRngCore to support CryptoRng trait objects
Fixes #1143.
2021-09-17 21:59:38 +02:00
Vinzent Steinberg
eac985fe73 Fix spelling 2021-09-17 21:35:48 +02:00
Diggory Hardy
3c8f92bfbb
Merge pull request #1180 from rust-random/work2
fill_via_chunks: use safe code via chunks_exact_mut on BE
2021-09-15 15:19:39 +01:00
Diggory Hardy
34a8f13d86 Replace ToLe with Observable, including as_byte_slice method 2021-09-15 09:31:34 +01:00
Diggory Hardy
19b7a76481 fill_via_chunks: make ToLe an unsafe trait 2021-09-14 08:17:26 +01:00