Skip to content

Implicit returns with multiple #cfg[...] cause compilation errors #38337

Closed
@Susurrus

Description

@Susurrus

If there are two different #cfg[...] one after each other and they utilize implicit returns (don't have a trailing ';'), then a compilation error will occur.

Example of the error: https://is.gd/fiScoc
Fixed: https://is.gd/Z87TE0

I believe this is a compiler bug because in the fixed version there's still an implicit return as part of the last #cfg[...] and there isn't an error about it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-parserArea: The lexing & parsing of Rust source code to an ASTC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions