Skip to content

module resolution regression on rustc 1.24.0-nightly (2017-12-21) #46936

Closed
@SergioBenitez

Description

@SergioBenitez

Beginning with rustc 1.24.0-nightly (250b49205 2017-12-21), rustc fails to find the appropriate file for a module when the module root is not mod_name/mod.rs or mod_name.rs (i.e, when using #[path]). This has broken ring, which has the following mod declarations:

In lib.rs:

#[path = "arithmetic/arithmetic.rs"]
mod arithmetic;

In arithmetic/arithmetic.rs:

pub mod montgomery;

And arithmetic/montgomery.rs contains the montgomery module code. This results in the following error:

error[E0583]: file not found for module `montgomery`
  --> $home/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.12.1/src/arithmetic/arithmetic.rs:15:9
   |
15 | pub mod montgomery;
   |         ^^^^^^^^^^
   |
   = help: name the file either arithmetic/montgomery.rs or arithmetic/montgomery/mod.rs inside the directory "$home/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.12.1/src/arithmetic"

Related issues: briansmith/ring#598, #46531

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions