Skip to content

Wrong error message when calling static method using dot notation #30391

Closed
@defyrlt

Description

@defyrlt

Playpen. For some reasons I wasn't able to get this error message when struct is in the same crate.

extern crate rustc;

use rustc::middle::ty::MethodCall;

fn main() {
    let mc = MethodCall.expr(); // ERROR: unresolved name `MethodCall` [E0425]
    // let mc = MethodCall; // same error here
}

Here's the error message I get when struct is in the same crate

<anon>:10:13: 10:16 error: `Foo` is the name of a struct or struct variant, but this expression uses it like a function name [E0423]

I think it should be raised in the case with crate too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions