These are chat archives for rust-lang/rust

18th
Apr 2019
Ingvar Stepanyan
@RReverser
Apr 18 11:48
@weiznich Yeah, transparent is the right way, and then you can just use transmute
which is essentially what you're doing in cast anyway
Gregory
@chmln
Apr 18 14:59
Anyone familiar with futures-preview? Feel like I'm hitting a wall here
use futures;

pub struct LineStream<T: futures::io::AsyncRead + Unpin> {
    inner: T,
}

impl<T: futures::io::AsyncRead + Unpin> LineStream<T> {
    pub fn new(inner: T) -> Self {
        inner.poll_read();
        Self { inner }
    }
}
error[E0599]: no method named `poll_read` found for type `T` in the current scope
 --> src/main.rs:9:15
  |
9 |         inner.poll_read();
  |               ^^^^^^^^^
  |
  = help: items from traits can only be used if the trait is implemented and in scope
  = note: the following trait defines an item `poll_read`, perhaps you need to implement it:
          candidate #1: `futures_io::if_std::AsyncRead`

error: aborting due to previous error
Brian Knapp
@knappador
Apr 18 19:34