Skip to content

Unused variables lead to scary diagnostics #18159

Closed
@ghost

Description

fn main() {
    let x;
}
<anon>:2:9: 2:10 error: unable to infer enough type information to locate the impl of the trait `core::kinds::Sized` for the type `<generic #1>`; type annotations required
<anon>:2     let x;
                 ^
<anon>:2:9: 2:10 note: all local variables must have a statically known size
<anon>:2     let x;

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-DSTsArea: Dynamically-sized types (DSTs)A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions