Skip to content

Use new path for importing PinMut #5

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

Closed
wants to merge 1 commit into from
Closed
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
14 changes: 7 additions & 7 deletions src/projection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
/// ```
/// # #![feature(pin, arbitrary_self_types)]
/// # #[macro_use] extern crate pin_utils;
/// # use std::mem::PinMut;
/// # use std::marker::Unpin;
/// # use std::pin::PinMut;
/// struct Foo<T> {
/// field: T,
/// }
Expand All @@ -32,10 +32,10 @@
macro_rules! unsafe_pinned {
($f:tt: $t:ty) => (
fn $f<'__a>(
self: &'__a mut $crate::core_reexport::mem::PinMut<Self>
) -> $crate::core_reexport::mem::PinMut<'__a, $t> {
self: &'__a mut $crate::core_reexport::pin::PinMut<Self>
) -> $crate::core_reexport::pin::PinMut<'__a, $t> {
unsafe {
$crate::core_reexport::mem::PinMut::map_unchecked(
$crate::core_reexport::pin::PinMut::map_unchecked(
self.reborrow(), |x| &mut x.$f
)
}
Expand All @@ -53,7 +53,7 @@ macro_rules! unsafe_pinned {
/// ```
/// # #![feature(pin, arbitrary_self_types)]
/// # #[macro_use] extern crate pin_utils;
/// # use std::mem::PinMut;
/// # use std::pin::PinMut;
/// # struct Bar;
/// struct Foo {
/// field: Bar,
Expand All @@ -71,10 +71,10 @@ macro_rules! unsafe_pinned {
macro_rules! unsafe_unpinned {
($f:tt: $t:ty) => (
fn $f<'__a>(
self: &'__a mut $crate::core_reexport::mem::PinMut<Self>
self: &'__a mut $crate::core_reexport::pin::PinMut<Self>
) -> &'__a mut $t {
unsafe {
&mut $crate::core_reexport::mem::PinMut::get_mut_unchecked(
&mut $crate::core_reexport::pin::PinMut::get_mut_unchecked(
self.reborrow()
).$f
}
Expand Down
4 changes: 2 additions & 2 deletions src/stack_pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// ```
/// # #![feature(pin)]
/// # #[macro_use] extern crate pin_utils;
/// # use core::mem::PinMut;
/// # use core::pin::PinMut;
/// # struct Foo {}
/// let foo = Foo { /* ... */ };
/// pin_mut!(foo);
Expand All @@ -18,7 +18,7 @@ macro_rules! pin_mut {
// ever again.
#[allow(unused_mut)]
let mut $x = unsafe {
$crate::core_reexport::mem::PinMut::new_unchecked(&mut $x)
$crate::core_reexport::pin::PinMut::new_unchecked(&mut $x)
};
)* }
}
2 changes: 1 addition & 1 deletion tests/projection.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![feature(pin, arbitrary_self_types)]
#[macro_use] extern crate pin_utils;
use std::mem::PinMut;
use std::marker::Unpin;
use std::pin::PinMut;

struct Foo<T1, T2> {
field1: T1,
Expand Down
2 changes: 1 addition & 1 deletion tests/stack_pin.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![feature(pin)]
#[macro_use] extern crate pin_utils;
use core::mem::PinMut;
use core::pin::PinMut;

#[test]
fn stack_pin() {
Expand Down