PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://github.com/jruderman/rust
Rust | 16 lines | 8 code | 5 blank | 3 comment | 1 complexity | c124d1987fc3af2a899d5c585f070e4a MD5 | raw file
 1// This tests that exports can have visible dependencies on things
 2// that are not exported, allowing for a sort of poor-man's ADT
 3
 4mod foo {
 5    export f;
 6    export g;
 7
 8    // not exported
 9    enum t { t1, t2, }
10
11    fn f() -> t { return t1; }
12
13    fn g(v: t) { assert (v == t1); }
14}
15
16fn main() { foo::g(foo::f()); }