Skip to content

Trouble resolving associated functions from a non-trait impl within a different module #9584

Closed
@SiegeLord

Description

@SiegeLord
use B::*;

pub struct S;
mod B
{
    impl super::S
    {
        pub fn new() -> super::S
        {
            super::S
        }
    }
}

fn main()
{
    let s = S::new();
}

Error:

test.rs:17:9: 17:15 error: unresolved name
test.rs:17      let s = S::new();
                        ^~~~~~
test.rs:17:9: 17:15 error: use of undeclared module `S`
test.rs:17      let s = S::new();
                        ^~~~~~
test.rs:17:9: 17:15 error: unresolved name `S::new`.
test.rs:17      let s = S::new();
                        ^~~~~~
error: aborting due to 3 previous errors
rustc --version
rustc 0.8 (76e8f08 2013-09-27 11:11:06 -0700)
host: x86_64-unknown-linux-gnu

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