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

Make pin_mut! soft-deprecated in favor of std::pin::pin! #39

Merged
merged 1 commit into from
Apr 5, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ Utilities for pinning

[Documentation][docs-url]

**Note:** Since Rust 1.68, all APIs in this crate are now soft-deprecated or deprecated:

- `pin_utils::pin_mut!` is soft-deprecated in favor of [`pin!` macro in the standard library](https://doc.rust-lang.org/std/pin/macro.pin.html) that stabilized in Rust 1.68.
- `pin_utils::{unsafe_pinned,unsafe_unpinned}` are **deprecated** in favor of safe alternatives: [pin-project](https://crates.io/crates/pin-project), [pin-project-lite](https://crates.io/crates/pin-project-lite)

## Usage

First, add this to your `Cargo.toml`:
Expand Down
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
//! Utilities for pinning
//!
//! **Note:** Since Rust 1.68, all APIs in this crate are now soft-deprecated or deprecated:
//!
//! - `pin_utils::pin_mut!` is soft-deprecated in favor of [`pin!` macro in the standard library](https://doc.rust-lang.org/std/pin/macro.pin.html) that stabilized in Rust 1.68.
//! - `pin_utils::{unsafe_pinned,unsafe_unpinned}` are **deprecated** in favor of safe alternatives: [pin-project](https://crates.io/crates/pin-project), [pin-project-lite](https://crates.io/crates/pin-project-lite)

#![no_std]
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
Expand Down
4 changes: 2 additions & 2 deletions src/projection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
/// [`drop`]: Drop::drop
#[deprecated(
since = "0.1.1",
note = "this macro is not safe; use pin-project or pin-project-lite crate instead"
note = "this macro is not safe; use safe pin-project or pin-project-lite crate instead"
)]
#[macro_export]
macro_rules! unsafe_pinned {
Expand Down Expand Up @@ -87,7 +87,7 @@ macro_rules! unsafe_pinned {
/// [`Pin`]: core::pin::Pin
#[deprecated(
since = "0.1.1",
note = "this macro is not safe; use pin-project or pin-project-lite crate instead"
note = "this macro is not safe; use safe pin-project or pin-project-lite crate instead"
)]
#[macro_export]
macro_rules! unsafe_unpinned {
Expand Down
3 changes: 3 additions & 0 deletions src/stack_pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
///
/// Can safely pin values that are not `Unpin` by taking ownership.
///
/// **Note:** Since Rust 1.68, this macro is soft-deprecated in favor of
/// [`pin!`](core::pin::pin) macro in the standard library.
///
/// # Example
///
/// ```rust
Expand Down