Skip to content

futures::select leads to unresolved macro $crate::select_internal! #8635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
valkum opened this issue Apr 23, 2021 · 2 comments
Closed

futures::select leads to unresolved macro $crate::select_internal! #8635

valkum opened this issue Apr 23, 2021 · 2 comments

Comments

@valkum
Copy link

valkum commented Apr 23, 2021

Getting a "unresolved macro $crate::select_internal!" error when using the following select macro:

MRE:

use tokio::net::TcpListener;
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use futures::future::FutureExt;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let listener = TcpListener::bind("127.0.0.1:8080").fuse();
    let mut shutdown_signal = tokio::signal::ctrl_c().boxed().fuse();
    tokio::pin!(listener);
    futures::select!{
        signal = shutdown_signal => {
            match signal {
                Ok(_) => {
                    
                }
                Err(err) => {
                    println!("Could not set up signal handler: {}", err);
                }
            }
        }
        d = listener => {
            todo!()
        }
    }
    Ok(())
}

Tested with current rust stable and an up to date rust analyzer version.

@lnicola
Copy link
Member

lnicola commented Apr 23, 2021

Probably duplicate of #6835.

@valkum
Copy link
Author

valkum commented Apr 23, 2021

Oh yeah. Didn't see that while searching. Closing my issue in favor of #6835.

@valkum valkum closed this as completed Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants