Skip to content

rustc error for missing struct construction args could be improved #8495

Closed
@pnkfelix

Description

@pnkfelix

Code:

struct S { now_req: bool }
trait T { }
impl T for S {}
fn main() {
    let x = @S as @T;
    println("Hello World");
}

rustc output:

/tmp/mt.rs:5:13: 5:14 error: unresolved name `S`.
/tmp/mt.rs:5     let x = @S as @T;
                          ^
error: aborting due to previous error

We can do better (in terms of looking S up in the struct namespace and informing the user that they need to provide the { ... } portion).

Metadata

Metadata

Assignees

No one assigned

    Labels

    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