Skip to content

Commit 0c15b63

Browse files
Merge pull request #1239 from carllerche/unpin-impl
impl Unpin for NotifyHandle with feature flag
2 parents b695882 + b6e37f1 commit 0c15b63

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ script:
2222
- cargo doc --no-deps
2323
- cargo doc --no-deps --manifest-path futures-cpupool/Cargo.toml
2424
- if [ "$BENCH" = "1" ]; then cargo bench; fi
25+
- if [[ "$TRAVIS_RUST_VERSION" == nightly ]]; then cargo test --features nightly; fi
2526
env:
2627
global:
2728
- secure: "iwVcMVIF7ZSY82fK5UyyUvVvJxMSYrbZawh1+4Oi8pvOdYq1gptcDoOC8jxWwCwrNF1b+/85n+jlEUngEqqSmV5PjAbWPjoc+u4Zn7CRi1AlxoUlvHPiQm4vM4Mkkd6GsqoIZttCeedU9m/w0nQ18uUtK8uD6vr2FVdcMnUnkYQAxuGOowGLrwidukzfBXMCu/JrwKMIbt61knAFiI/KJknu0h1mRrhpeF/sQ3tJFzRRcQeFJkbfwDzltMpPo1hq5D3HI4ONjYi/qO2pwUhDk4umfp9cLW9MS8rQvptxJTQmWemHi+f2/U4ld6a0URL6kEuMkt/EbH0A74eFtlicfRs44dX9MlWoqbLypnC3ymqmHcpwcwNA3HmZyg800MTuU+BPK41HIPdO9tPpxjHEiqvNDknH7qs+YBnis0eH7DHJgEjXq651PjW7pm+rnHPwsj+OzKE1YBNxBQZZDkS3VnZJz+O4tVsOzc3IOz0e+lf7VVuI17C9haj117nKp3umC4MVBA0S8RfreFgqpyDeY2zwcqOr0YOlEGGRl0vyWP8Qcxx12kQ7+doLolt6Kxda4uO0hKRmIF6+qki1T+L7v8BOGOtCncz4f7IX48eQ7+Wu0OtglRn45qAa3CxjUuW6xX3KSNH66PCXV0Jtp8Ga2SSevX2wtbbFu9f+9R+PQY4="

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ appveyor = { repository = "rust-lang-nursery/futures-rs" }
2121
[dependencies]
2222

2323
[features]
24+
nightly = []
2425
use_std = []
2526
with-deprecated = []
2627
default = ["use_std", "with-deprecated"]

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
#![no_std]
159159
#![deny(missing_docs, missing_debug_implementations)]
160160
#![doc(html_root_url = "https://docs.rs/futures/0.1")]
161+
#![cfg_attr(feature = "nightly", feature(pin))]
161162

162163
#[macro_use]
163164
#[cfg(feature = "use_std")]

src/task_impl/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,3 +712,11 @@ impl<T: Notify> From<&'static T> for NotifyHandle {
712712
unsafe { NotifyHandle::new(src as *const _ as *mut StaticRef<T>) }
713713
}
714714
}
715+
716+
#[cfg(feature = "nightly")]
717+
mod nightly {
718+
use super::NotifyHandle;
719+
use core::marker::Unpin;
720+
721+
impl Unpin for NotifyHandle {}
722+
}

src/task_impl/std/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,3 +700,12 @@ impl<T> From<Arc<T>> for NotifyHandle
700700
}
701701
}
702702
}
703+
704+
#[cfg(feature = "nightly")]
705+
mod nightly {
706+
use super::{TaskUnpark, UnparkEvents};
707+
use core::marker::Unpin;
708+
709+
impl Unpin for TaskUnpark {}
710+
impl Unpin for UnparkEvents {}
711+
}

0 commit comments

Comments
 (0)