Skip to content

needless_continue wrongly unmangled macros #15548

@profetia

Description

@profetia

Summary

needless_continue wrongly showed macro definition instead of invocation

Reproducer

I tried this code:

fn foo() {
    loop {
        if todo!() {
        } else {
            continue;
        }
    }
}

I expected to see this happen:

        if todo!() {
// merged code follows:

        }

Instead, this happened:

        if $crate::panicking::panic("not yet implemented") {
// merged code follows:

        }

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

@rustbot label +I-suggestion-causes-error

Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thingI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when applied

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions