Skip to content

Compiler panic on function shadowing #22468

Closed
@ekelly

Description

@ekelly

Compiler expects function, finds &str. This causes a compiler panic when attempting to compile.

fn main() {
    let train = "foo";
    let x = train("hello");
}

fn train(file: &str) -> bool {
    true
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions