Skip to content

Commit 15f68a6

Browse files
committed
Added diagnostic for pin! macro in addition to Box::pin if Unpin isn't implemented
1 parent 9f74343 commit 15f68a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/marker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ unsafe impl<T: ?Sized> Freeze for &mut T {}
823823
/// [`pin` module]: crate::pin
824824
#[stable(feature = "pin", since = "1.33.0")]
825825
#[rustc_on_unimplemented(
826-
note = "consider using `Box::pin`",
826+
note = "consider using the `pin!` macro\nconsider using `Box::pin` if you need to access the pinned value outside of the current scope",
827827
message = "`{Self}` cannot be unpinned"
828828
)]
829829
#[lang = "unpin"]

0 commit comments

Comments
 (0)