Skip to content

Can't use names to impl them #16145

Closed
Closed
@kmcallister

Description

@kmcallister
struct Foo;

mod bar {
    use super::Foo;
    impl Foo {
        fn f() { }
    }
}

gives

baz.rs:5:10: 5:13 error: found module name used as a type: impl bar::Foo::Foo (id=8)
baz.rs:5     impl Foo {
                  ^~~

when impl super::Foo works fine.

rustc 0.11.0 (49bc17b 2014-07-07 17:16:34 +0000)

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