Skip to content

Commit

Permalink
Stabilized weak support
Browse files Browse the repository at this point in the history
As of 1.45, it is stable (currently in beta). Removing need of nightly
feature and using a different named feature.
  • Loading branch information
vorner committed Jun 5, 2020
1 parent ee8b86e commit 1cd19c3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ script:
(test "$TRAVIS_RUST_VERSION" == 1.26.0 || cargo test --release -- --ignored) &&
cargo doc --no-deps &&
(test "$TRAVIS_RUST_VERSION" != nightly || cargo test --all --release --benches --all-features) &&
(test "$TRAVIS_RUST_VERSION" != beta || cargo test --all --release --all-features) &&
(test "$TRAVIS_RUST_VERSION" == 1.26.0 || cargo clippy --all --tests -- --deny clippy::all) &&
(test "$TRAVIS_RUST_VERSION" == 1.26.0 || cargo fmt --all -- --check)
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* Rename the `unstable-weak` to `weak` feature. The support is now available on
1.45 (currently in beta).

# 0.4.6

* Adjust to `Weak::as_ptr` from std (the weak pointer support, relying on
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ appveyor = { repository = "vorner/arc-swap" }
maintenance = { status = "actively-developed" }

[features]
unstable-weak = []
weak = []

[workspace]
members = ["benchmarks"]
Expand Down
13 changes: 5 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#![deny(missing_docs, warnings)]
// We aim at older rust too, one without dyn
#![allow(unknown_lints, bare_trait_objects, renamed_and_removed_lints)]
#![cfg_attr(feature = "unstable-weak", feature(weak_into_raw))]

//! Making [`Arc`][Arc] itself atomic
//!
Expand Down Expand Up @@ -221,11 +220,9 @@
//!
//! # Features
//!
//! The `unstable-weak` feature adds the ability to use arc-swap with the [Weak] pointer too,
//! through the [ArcSwapWeak] type. This requires the nightly Rust compiler. Also, the interface
//! and support **is not** part of API stability guarantees and may be arbitrarily changed or
//! removed in future releases (it is mostly waiting for the `weak_into_raw` nightly feature to
//! stabilize before stabilizing it in this crate).
//! The `weak` feature adds the ability to use arc-swap with the [Weak] pointer too,
//! through the [ArcSwapWeak] type. The needed std support is stabilized in rust version 1.45 (as
//! of now in beta).
//!
//! # Internal details
//!
Expand Down Expand Up @@ -276,7 +273,7 @@ mod compile_fail_tests;
mod debt;
pub mod gen_lock;
mod ref_cnt;
#[cfg(feature = "unstable-weak")]
#[cfg(feature = "weak")]
mod weak;

use std::fmt::{Debug, Display, Formatter, Result as FmtResult};
Expand Down Expand Up @@ -1357,7 +1354,7 @@ pub type IndependentArcSwap<T> = ArcSwapAny<Arc<T>, PrivateUnsharded>;
/// [`ArcSwapAny`](struct.ArcSwapAny.html).
///
/// [Weak]: std::sync::Weak
#[cfg(feature = "unstable-weak")]
#[cfg(feature = "weak")]
pub type ArcSwapWeak<T> = ArcSwapAny<std::sync::Weak<T>>;

#[cfg(test)]
Expand Down

0 comments on commit 1cd19c3

Please sign in to comment.