Skip to content

Commit b21e4f4

Browse files
committed
Rust 1.10.0 compatibility
1 parent a6e6ece commit b21e4f4

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ matrix:
1212
after_success:
1313
- travis-cargo doc-upload
1414
- os: linux
15-
rust: 1.17.0
15+
rust: 1.10.0
1616
script: cargo test
1717
sudo: false
1818
script:

src/stream/split.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
use {StartSend, Sink, Stream, Poll, Async, AsyncSink};
1+
use std::any::Any;
22
use std::error::Error;
33
use std::fmt;
4+
5+
use {StartSend, Sink, Stream, Poll, Async, AsyncSink};
46
use sync::BiLock;
57

68
/// A `Stream` part of the split pair
@@ -96,7 +98,7 @@ impl<T> fmt::Display for ReuniteError<T> {
9698
}
9799
}
98100

99-
impl<T> Error for ReuniteError<T> {
101+
impl<T: Any> Error for ReuniteError<T> {
100102
fn description(&self) -> &str {
101103
"tried to reunite a SplitStream and SplitSink that don't form a pair"
102104
}

src/sync/bilock.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use std::any::Any;
12
use std::boxed::Box;
23
use std::cell::UnsafeCell;
34
use std::error::Error;
@@ -137,7 +138,7 @@ impl<T> BiLock<T> {
137138
/// recover the original value. Succeeds only if the two `BiLock<T>`s
138139
/// originated from the same call to `BiLock::new`.
139140
pub fn reunite(self, other: Self) -> Result<T, ReuniteError<T>> {
140-
if Arc::ptr_eq(&self.inner, &other.inner) {
141+
if &*self.inner as *const _ == &*other.inner as *const _ {
141142
drop(other);
142143
let inner = Arc::try_unwrap(self.inner)
143144
.ok()
@@ -196,7 +197,7 @@ impl<T> fmt::Display for ReuniteError<T> {
196197
}
197198
}
198199

199-
impl<T> Error for ReuniteError<T> {
200+
impl<T: Any> Error for ReuniteError<T> {
200201
fn description(&self) -> &str {
201202
"tried to reunite two BiLocks that don't form a pair"
202203
}

0 commit comments

Comments
 (0)