Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.15.0 #198

Merged
merged 4 commits into from Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,11 @@

-

## 1.15.0

- Increase minimal supported Rust version to 1.56.0.
- Implement `UnwindSafe` even if the `std` feature is disabled.

## 1.14.0

- Add extension to `unsync` and `sync` `Lazy` mut API:
Expand Down
186 changes: 115 additions & 71 deletions Cargo.lock.msrv

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
@@ -1,9 +1,10 @@
[package]
name = "once_cell"
version = "1.14.0"
version = "1.15.0-pre.1"
authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"
rust-version = "1.56"

description = "Single assignment cells and lazy values."
readme = "README.md"
Expand Down
10 changes: 2 additions & 8 deletions src/lib.rs
Expand Up @@ -267,7 +267,7 @@
//!
//! # Minimum Supported `rustc` Version
//!
//! This crate's minimum supported `rustc` version is `1.36.0`.
//! This crate's minimum supported `rustc` version is `1.56.0`.
//!
//! If only the `std` feature is enabled, MSRV will be updated conservatively.
//! When using other features, like `parking_lot`, MSRV might be updated more frequently, up to the latest stable.
Expand Down Expand Up @@ -348,11 +348,9 @@ pub mod unsync {
cell::{Cell, UnsafeCell},
fmt, hint, mem,
ops::{Deref, DerefMut},
panic::{RefUnwindSafe, UnwindSafe},
};

#[cfg(feature = "std")]
use std::panic::{RefUnwindSafe, UnwindSafe};

/// A cell which can be written to only once. It is not thread safe.
///
/// Unlike [`std::cell::RefCell`], a `OnceCell` provides simple `&`
Expand Down Expand Up @@ -382,9 +380,7 @@ pub mod unsync {
// `&unsync::OnceCell` to sneak a `T` through `catch_unwind`,
// by initializing the cell in closure and extracting the value in the
// `Drop`.
#[cfg(feature = "std")]
impl<T: RefUnwindSafe + UnwindSafe> RefUnwindSafe for OnceCell<T> {}
#[cfg(feature = "std")]
impl<T: UnwindSafe> UnwindSafe for OnceCell<T> {}

impl<T> Default for OnceCell<T> {
Expand Down Expand Up @@ -680,7 +676,6 @@ pub mod unsync {
init: Cell<Option<F>>,
}

#[cfg(feature = "std")]
impl<T, F: RefUnwindSafe> RefUnwindSafe for Lazy<T, F> where OnceCell<T>: RefUnwindSafe {}

impl<T: fmt::Debug, F> fmt::Debug for Lazy<T, F> {
Expand Down Expand Up @@ -1225,7 +1220,6 @@ pub mod sync {
unsafe impl<T, F: Send> Sync for Lazy<T, F> where OnceCell<T>: Sync {}
// auto-derived `Send` impl is OK.

#[cfg(feature = "std")]
impl<T, F: RefUnwindSafe> RefUnwindSafe for Lazy<T, F> where OnceCell<T>: RefUnwindSafe {}

impl<T, F> Lazy<T, F> {
Expand Down
2 changes: 1 addition & 1 deletion xtask/src/main.rs
Expand Up @@ -5,7 +5,7 @@ use std::time::Instant;

use xshell::{cmd, Shell};

const MSRV: &str = "1.36.0";
const MSRV: &str = "1.56.0";

fn main() -> xshell::Result<()> {
let sh = Shell::new()?;
Expand Down