Skip to content

rustc: impl on unknown type generates incorrect error #14691

Closed
@aturon

Description

@aturon

The code

impl Foo {}
fn main() {}

generates the error

impl-bug.rs:1:6: 1:9 error: found module name used as a type: impl Foo::Foo (id=4)
impl-bug.rs:1 impl Foo {}
                   ^~~

but should instead give an error saying that Foo is not a known type. (This is the entire file, so no module named Foo is in scope.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions