Skip to content

async_yields_async wrongly unmangled macros #15552

@profetia

Description

@profetia

Summary

async_yields_async wrongly showed macro definition instead of invocation.

Reproducer

I tried this code:

fn foo() {
    async fn bar(i: i32) {}

    macro_rules! call_bar {
        ($e:expr) => {
            bar($e)
        };
    }

    let x = async { call_bar!(5) };
}

I expected to see this happen:

  --> src/main.rs:13:13
   |
13 |             bar($e)
   |             ^^^^^^^
   |             |
   |             awaitable value not awaited
   |             help: consider awaiting this value: `call_bar!(5).await`

Instead, this happened:

  --> src/main.rs:13:13
   |
13 |             bar($e)
   |             ^^^^^^^
   |             |
   |             awaitable value not awaited
   |             help: consider awaiting this value: `bar($e).await`

Version

rustc 1.91.0-nightly (6ba0ce409 2025-08-21)
binary: rustc
commit-hash: 6ba0ce40941eee1ca02e9ba49c791ada5158747a
commit-date: 2025-08-21
host: x86_64-unknown-linux-gnu
release: 1.91.0-nightly
LLVM version: 21.1.0

Additional Labels

No response

Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thing

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions