librustc: Enforce that extern mod directives come first, then use directives, then items.
Resolve them in this order as well.
This commit is contained in:
parent
8b56a8380b
commit
0a4d0f37ca
14 changed files with 332 additions and 335 deletions
6
src/test/auxiliary/extern_mod_ordering_lib.rs
Normal file
6
src/test/auxiliary/extern_mod_ordering_lib.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#[crate_type="lib"];
|
||||
|
||||
pub mod extern_mod_ordering_lib {
|
||||
pub fn f() {}
|
||||
}
|
||||
|
||||
11
src/test/run-pass/extern-mod-ordering-exe.rs
Normal file
11
src/test/run-pass/extern-mod-ordering-exe.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// aux-build:extern_mod_ordering_lib.rs
|
||||
// xfail-fast
|
||||
|
||||
extern mod extern_mod_ordering_lib;
|
||||
|
||||
use extern_mod_ordering_lib::extern_mod_ordering_lib;
|
||||
|
||||
fn main() {
|
||||
extern_mod_ordering_lib::f();
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue