Skip to content

Commit 6ebe74c

Browse files
committed
Deprecate unsafe pin projection macros
1 parent fcac056 commit 6ebe74c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/projection.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
///
3737
/// [`Unpin`]: core::marker::Unpin
3838
/// [`drop`]: Drop::drop
39+
#[deprecated(
40+
since = "0.1.1",
41+
note = "this macro is not safe; use pin-project or pin-project-lite crate instead"
42+
)]
3943
#[macro_export]
4044
macro_rules! unsafe_pinned {
4145
($f:tt: $t:ty) => {
@@ -81,6 +85,10 @@ macro_rules! unsafe_pinned {
8185
/// avoid consuming the [`Pin`].
8286
///
8387
/// [`Pin`]: core::pin::Pin
88+
#[deprecated(
89+
since = "0.1.1",
90+
note = "this macro is not safe; use pin-project or pin-project-lite crate instead"
91+
)]
8492
#[macro_export]
8593
macro_rules! unsafe_unpinned {
8694
($f:tt: $t:ty) => {

tests/projection.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(deprecated)]
2+
13
use pin_utils::{pin_mut, unsafe_pinned, unsafe_unpinned};
24
use std::marker::Unpin;
35
use std::pin::Pin;

0 commit comments

Comments
 (0)