tokio-rs/console

console-subscriber build error vs tokio v1.21.0

Closed this issue · 2 comments

What crate(s) in this repo are involved in the problem?

console-subscriber

What is the issue?

One of the changes to make task::Builder::spawn* methods fallible in tokio 1.21.0 I think is causing a build error in console-subscriber

How can the bug be reproduced?

In this repo I just did cargo update and cargo build

Logs, error output, etc

   Compiling console-subscriber v0.1.7 (/Users/redshiftzero/Documents/console/console-subscriber)
error[E0308]: mismatched types
    --> console-subscriber/src/lib.rs:1066:12
     |
1061 | ) -> tokio::task::JoinHandle<T>
     |      -------------------------- expected `tokio::task::JoinHandle<T>` because of return type
...
1066 |     return tokio::task::Builder::new().name(_name).spawn(task);
     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `tokio::task::JoinHandle`, found enum `Result`
     |
     = note: expected struct `tokio::task::JoinHandle<_>`
                  found enum `Result<tokio::task::JoinHandle<_>, std::io::Error>`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `console-subscriber` due to previous error
warning: build failed, waiting for other jobs to finish...

Versions

tokio 1.21.0

Possible solution

No response

Additional context

No response

Would you like to work on fixing this bug?

maybe

I have same problem

This should be an easy fix.