Closed
Description
@brson suggested me open a new issue on this idea, "it seems worth exploring", he said. He don't want this to get buried in #11745 too. See comments in #11787.
The Problem
To use a crate in rust, at least two lines are required currently:
extern mod xxx;
use xxx::a::b;
In a large project, we need to use many crates, particularly after extra's dissolution (#11787). The more crates we need, the more lines extern mod xxx
need to write, which is a pain:
extern mod crate1; // do we really need to write this?
extern mod crate2;
extern mod crate3;
extern mod crate4;
......
use crate1::*; // compiler can infers "extern mod crate1" from here
use crate2::*;
use crate3::*;
use crate4::*;
......
The Solution
Since we must write lines such as use xxx::a::b
, the compiler should always knows I'm using the crate xxx. So the extern mod xxx
is redundant, it should be optional, unless compiler got ambiguity in non-common situations.
Metadata
Metadata
Assignees
Labels
No labels