Skip to content

Commit

Permalink
Set MSRV to 1.80
Browse files Browse the repository at this point in the history
This version added `size_of` to the prelude and `LazyLock`.

Fixes #67.
  • Loading branch information
nvzqz committed Dec 5, 2024
1 parent f5ff95b commit d450e6d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
14 changes: 10 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Versioning](http://semver.org/spec/v2.0.0.html).

### Changed

- Set [MSRV] to 1.80 for `size_of` [`LazyLock`] and new prelude imports.

- Reduced thread pool memory usage by many kilobytes by using rendezvous
channels instead of array-based channels.

Expand Down Expand Up @@ -200,8 +202,8 @@ Versioning](http://semver.org/spec/v2.0.0.html).
### Added

- [`black_box_drop`](https://docs.rs/divan/0.1.5/divan/fn.black_box_drop.html)
convenience function for [`black_box`] + [`drop`][drop_fn]. This is useful
when benchmarking a lazy [`Iterator`] to completion with `for_each`:
convenience function for [`black_box`] + [`drop`]. This is useful when
benchmarking a lazy [`Iterator`] to completion with `for_each`:

```rust
#[divan::bench]
Expand Down Expand Up @@ -369,14 +371,18 @@ Initial release. See [blog post](https://nikolaivazquez.com/blog/divan/).
[`Any`]: https://doc.rust-lang.org/std/any/trait.Any.html
[`Copy`]: https://doc.rust-lang.org/std/marker/trait.Copy.html
[`Debug`]: https://doc.rust-lang.org/std/fmt/trait.Debug.html
[`drop`]: https://doc.rust-lang.org/std/mem/fn.drop.html
[`Drop`]: https://doc.rust-lang.org/std/ops/trait.Drop.html
[`Iterator`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html
[`LazyLock`]: https://doc.rust-lang.org/std/sync/struct.LazyLock.html
[`Send`]: https://doc.rust-lang.org/std/marker/trait.Send.html
[`size_of`]: https://doc.rust-lang.org/std/mem/fn.size_of.html
[`Sync`]: https://doc.rust-lang.org/std/marker/trait.Sync.html
[`thread_local!`]: https://doc.rust-lang.org/std/macro.thread_local.html
[`ToString`]: https://doc.rust-lang.org/std/string/trait.ToString.html
[available parallelism]: https://doc.rust-lang.org/std/thread/fn.available_parallelism.html
[drop_fn]: https://doc.rust-lang.org/std/mem/fn.drop.html
[slice]: https://doc.rust-lang.org/std/primitive.slice.html
[`thread_local!`]: https://doc.rust-lang.org/std/macro.thread_local.html

[MSRV]: https://doc.rust-lang.org/cargo/reference/rust-version.html

[`pthread_key_create`]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_key_create.html
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "divan"
version = "0.1.16"
rust-version = "1.80.0"
edition = "2021"
authors = ["Nikolai Vazquez"]
license = "MIT OR Apache-2.0"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ A guide is being worked on. In the meantime, see:

## Getting Started

This library requires Rust 1.80 or later.

1. Add the following to your project's [`Cargo.toml`](https://doc.rust-lang.org/cargo/reference/manifest.html):

```toml
Expand Down
2 changes: 1 addition & 1 deletion src/bench/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ impl<'a> BenchContext<'a> {
}

unsafe {
assert_eq!(size_of::<RawSample>(), size_of::<Option<RawSample>>());
assert_eq!(mem::size_of::<RawSample>(), mem::size_of::<Option<RawSample>>());
std::slice::from_raw_parts(raw_samples.as_ptr().cast(), raw_samples.len())
}
};
Expand Down

0 comments on commit d450e6d

Please sign in to comment.