Skip to content

Commit

Permalink
Make pin_mut! soft-deprecated in favor of std::pin::pin!
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Apr 5, 2024
1 parent c6eb141 commit c635c0c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
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

0 comments on commit c635c0c

Please sign in to comment.