Skip to content

Commit

Permalink
Merge #198
Browse files Browse the repository at this point in the history
198: Release 1.15.0 r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
  • Loading branch information
bors[bot] and matklad authored Sep 15, 2022
2 parents 2487d34 + 99c67b7 commit 5ca60af
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 82 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit 5ca60af

Please sign in to comment.