Replies: 4 comments
-
It seems that your compiler doesn't like something in |
Beta Was this translation helpful? Give feedback.
-
I tried to install the latest version of the compiler but without success (no version found by the installer for an armv7l platform), the version of the compiler into the raspberrypi OS repo is 1.41.1, I tried reinstalling it but no success. |
Beta Was this translation helpful? Give feedback.
-
Tokio's current MSRV is 1.45, I would suggest cross compiling if the toolchain isn't available for Raspberry Pi. |
Beta Was this translation helpful? Give feedback.
-
I'll see about cross compiling it asap, thanks for your time
Le dim. 9 mai 2021 à 16:19, Naim A. ***@***.***> a écrit :
… Tokio's current MSRV is 1.45, I would suggest cross compiling if the
toolchain isn't available for Raspberry Pi.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#95 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKXELFJWTFUHBAJASE545HLTM2KY5ANCNFSM44KTBW2Q>
.
|
Beta Was this translation helpful? Give feedback.
-
This is maybe a dumb issue or a mistake I made but I get this error code while trying to compile it via cargo build --release:
cargo build --release Compiling tokio v1.1.0 Compiling serde v1.0.120 Compiling pin-project v0.4.27 Compiling pin-project v1.0.4 Compiling tracing-futures v0.2.4 error: unexpected
selfparameter in function --> /home/oops/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.1.0/src/net/tcp/stream.rs:624:40 | 624 | pub fn try_read_buf<B: BufMut>(&self, buf: &mut B) -> io::Result<usize> { | ^^^^^ not valid as function parameter | = note:
self` is only valid as the first parameter of an associated functionerror: expected one of
async
,const
,crate
,default
,extern
,fn
,pub
,type
, orunsafe
, found#[doc = r" Try to read data from the stream into the provided buffer, advancing the"] #[doc = r" buffer's internal cursor, returning how many bytes were read."] #[doc = r""] #[doc = r" Receives any pending data from the socket but does not wait for new data"] #[doc = r" to arrive. On success, returns the number of bytes read. Because"] #[doc = r"
try_read_buf()is non-blocking, the buffer does not have to be stored by"] #[doc = r" the async task and can exist entirely on the stack."] #[doc = r""] #[doc = r" Usually, [
readable()] or [
ready()] is used with this function."] #[doc = r""] #[doc = r" [
readable()]: TcpStream::readable()"] #[doc = r" [
ready()]: TcpStream::ready()"] #[doc = r""] #[doc = r" # Return"] #[doc = r""] #[doc = r" If data is successfully read,
Ok(n)is returned, where
nis the"] #[doc = r" number of bytes read.
Ok(0)indicates the stream's read half is closed"] #[doc = r" and will no longer yield data. If the stream is not ready to read data"] #[doc = r"
Err(io::ErrorKind::WouldBlock)is returned."] #[doc = r""] #[doc = r" # Examples"] #[doc = r""] #[doc = r" ```no_run"] #[doc = r" use tokio::net::TcpStream;"] #[doc = r" use std::error::Error;"] #[doc = r" use std::io;"] #[doc = r""] #[doc = r" #[tokio::main]"] #[doc = r" async fn main() -> Result<(), Box<dyn Error>> {"] #[doc = r" // Connect to a peer"] #[doc = r#" let stream = TcpStream::connect("127.0.0.1:8080").await?;"#] #[doc = r""] #[doc = r" loop {"] #[doc = r" // Wait for the socket to be readable"] #[doc = r" stream.readable().await?;"] #[doc = r""] #[doc = r" let mut buf = Vec::with_capacity(4096);"] #[doc = r""] #[doc = r" // Try to read data, this may still fail with
WouldBlock"] #[doc = r" // if the readiness event is a false positive."] #[doc = r" match stream.try_read_buf(&mut buf) {"] #[doc = r" Ok(0) => break,"] #[doc = r" Ok(n) => {"] #[doc = r#" println!("read {} bytes", n);"#] #[doc = r" }"] #[doc = r" Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => {"] #[doc = r" continue;"] #[doc = r" }"] #[doc = r" Err(e) => {"] #[doc = r" return Err(e.into());"] #[doc = r" }"] #[doc = r" }"] #[doc = r" }"] #[doc = r""] #[doc = r" Ok(())"] #[doc = r" }"] #[doc = r" ```"] pub fn try_read_buf<B: BufMut>(self: (/*ERROR*/), buf: &mut B) -> io::Result<usize> { self.io.registration().try_io(Interest::READABLE, || { use std::io::Read; let dst = buf.chunk_mut(); let dst = unsafe { &mut *(dst as *mut _ as *mut [std::mem::MaybeUninit<u8>] as *mut [u8]) }; let n = (&*self.io).read(dst)?; unsafe { buf.advance_mut(n); } Ok(n) }) }
--> /home/oops/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.1.0/src/macros/cfg.rs:132:13
|
131 | #[cfg_attr(docsrs, doc(cfg(feature = "io-util")))]
| - expected one of 9 possible tokens
132 | $item
| ^^^^^ unexpected token
|
::: /home/oops/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.1.0/src/net/tcp/stream.rs:566:5
|
566 | / cfg_io_util! {
567 | | /// Try to read data from the stream into the provided buffer, advancing the
568 | | /// buffer's internal cursor, returning how many bytes were read.
569 | | ///
... |
642 | | }
643 | | }
| |_____- in this macro invocation
error: aborting due to 2 previous errors
error: could not compile
tokio
.warning: build failed, waiting for other jobs to finish...
error: build failed`
Beta Was this translation helpful? Give feedback.
All reactions