Skip to content

the join! macro leaks some symbols into the caller's scope #7764

@oconnor663

Description

@oconnor663

For example, this compiles even though I haven't imported the RotatorSelect trait anywhere:

#[tokio::main]
async fn main() {
    tokio::join!(async {
        fn foo(_: impl RotatorSelect) {}
    });
}

Looking at the output of cargo expand on that example, I think the full set of symbols that gets leaked into the caller's scope is:

use ::tokio::macros::support::{
    maybe_done, poll_fn, Future, Pin, RotatorSelect,
};
use ::tokio::macros::support::Poll::{Ready, Pending};

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tokioArea: The main tokio crateC-bugCategory: This is a bug.M-macrosModule: macros in the main Tokio crate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions