Skip to content

Duplicate module warning error #2359

Closed
Closed
@jesse99

Description

@jesse99

I don't have a repro for this, but it's a really annoying error because it seems to be a lie and it's not at all clear how users can fix it. I had a library depending on three other libraries. The external libraries were copied into a local project/bin directory so that I had more control over them.

This was all working fine until I decided to rename my project. As part of this process I removed my bin directory and copied new versions of the external libraries into bin. Now when I do rustc --out-dir bin -L bin -O src/rwebserve.rc I get:

src/rwebserve.rc:11:0: 11:42 error: duplicate definition of module socket
src/rwebserve.rc:11 use socket (name = "socket", vers = "0.1");

If I change the use statement to "use socketXXX" I get the same error which makes me think that it is not a duplicate definition (and I don't see how it would be). My guess is that this is caused when using libraries built by slightly different versions of rustc. Unfortunately I now get an ICE trying to build one of the libraries so I can't try it out atm (currently building a new rustc in the hopes that that will fix the ICE).

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