Skip to content

Cannot resolve module path properly in simple setting #4402

@CohenArthur

Description

@CohenArthur

With the following bar.rs file:

use foo::Bar;

pub mod foo;

fn main() {
    let a = Bar;
}

and in the same directory a foo.rs file:

pub struct Bar;

we have the following error:

bar.rs:3:5: error: no candidate found for module foo
    3 | pub mod foo;
      |     ^~~
bar.rs:3:5: error: no candidate found for module foo
bar.rs:1:10: error: unresolved import ‘foo::Bar[E0433]
    1 | use foo::Bar;
      |          ^~~
bar.rs:6:13: error: cannot find value ‘Barin this scope [E0425]
    6 |     let a = Bar;
      |             ^~~

rustc bar.rs does not produce any error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions