/src/test/run-pass/export-abstract-tag.rs

http://github.com/jruderman/rust · Rust · 13 lines · 7 code · 4 blank · 2 comment · 0 complexity · 1d45e2b20c6b5f986175ae85bc60edd5 MD5 · raw file

  1. // We can export tags without exporting the variants to create a simple
  2. // sort of ADT.
  3. mod foo {
  4. export t;
  5. export f;
  6. enum t { t1, }
  7. fn f() -> t { return t1; }
  8. }
  9. fn main() { let v: foo::t = foo::f(); }