Implement simple module export
This commit is contained in:
parent
40624e35d7
commit
459b0ec833
6 changed files with 143 additions and 14 deletions
19
src/test/compile-fail/export-boot.rs
Normal file
19
src/test/compile-fail/export-boot.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// xfail-stage0
|
||||
// error-pattern: unknown module item
|
||||
|
||||
// rustboot has a different error message than rustc
|
||||
// this test can die with rustboot, or rustc's error can change
|
||||
|
||||
mod foo {
|
||||
export x;
|
||||
fn x(int y) {
|
||||
log y;
|
||||
}
|
||||
fn z(int y) {
|
||||
log y;
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
foo.z(10);
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
// xfail-stage0
|
||||
// error-pattern: unknown module item
|
||||
// xfail-boot
|
||||
// error-pattern: unresolved name
|
||||
mod foo {
|
||||
export x;
|
||||
fn x(int y) {
|
||||
|
|
|
|||
25
src/test/compile-fail/export2.rs
Normal file
25
src/test/compile-fail/export2.rs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
// xfail-boot
|
||||
// error-pattern: unresolved name
|
||||
|
||||
mod foo {
|
||||
export x;
|
||||
|
||||
fn x() {
|
||||
bar.x();
|
||||
}
|
||||
}
|
||||
|
||||
mod bar {
|
||||
export y;
|
||||
|
||||
fn x() {
|
||||
log "x";
|
||||
}
|
||||
|
||||
fn y() {
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
foo.x();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue