Closed
Description
The following code does not build on Rust 0.7:
mod a {
extern mod extra;
use extra::json;
}
fn main() {}
Output:
/tmp/b.rc:4:8: 4:13 error: unresolved import. maybe a missing `extern mod extra`?
/tmp/b.rc:4 use extra::json;
^~~~~
/tmp/b.rc:4:8: 4:19 error: failed to resolve import `extra::json`
/tmp/b.rc:4 use extra::json;
^~~~~~~~~~~
error: aborting due to 2 previous errors
Moving extern mode extra;
to the crate top level fixes the issue. The current error message is very confusing at best, especially if the module is a separate .rs file.
Please either change extern mod foo;
to work in modules, or make it an error. Don’t ignore it silently.
UPDATE: See comments below.