rust/src/test/run-pass/export-unexported-dep.rs

17 lines
316 B
Rust
Raw Normal View History

// This tests that exports can have visible dependencies on things
// that are not exported, allowing for a sort of poor-man's ADT
mod foo {
2011-07-27 07:19:39 -05:00
export f;
export g;
2011-07-27 07:19:39 -05:00
// not exported
enum t { t1, t2, }
2011-07-27 07:19:39 -05:00
fn f() -> t { ret t1; }
2011-07-27 07:19:39 -05:00
fn g(v: t) { assert (v == t1); }
}
fn main() { foo::g(foo::f()); }