Skip to content

super let is allowed in nonsensical positions #142281

Open
@theemathas

Description

@theemathas

I tried this code:

#![feature(super_let)]

fn f() {
    super let a = 1;
}

fn g() {
    loop {
        super let b = 2;
    }
}

fn h() {
    while {
        super let c = 3;
        false
    } {}
}

I expected all three functions to fail to compile, since super let is used in places that don't make sense. However, they compiled without errors. (As far as I can tell, these super let bindings behave exactly like normal let bindings.)

@rustbot labels +F-super_let

Meta

Reproducible on the playground with 1.89.0-nightly (2025-06-09 d13a431a6cc69cd65efe)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-super_letit's super, let's go!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