Skip to content

Name resolution has changed between 1.7.0 and 1.8.0 #33458

Closed
@matklad

Description

@matklad

The following program:

fn main() {
    let x: i32 = 92;
    {
        const x: i32  = 62;
        println!("{}", x);
    }
}

prints 92 with rustc 1.7.0 and 62 with rustc 1.8.0. Is this intentional? I have not found a mention in the release notes. Also the reference could be a bit more clear on the scoping rules :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-langRelevant to the language 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