rust/src/test/run-pass/export-unexported-dep.rs
Marijn Haverbeke b24f978011 Drop arguments on the caller side, not the callee
This makes it easier for the caller to optimize the take/drop away for
temporary values, and opens up new possibilities for alias handling.

Breaks tail calls.
2011-08-22 10:16:09 +02:00

17 lines
315 B
Rust

// 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 {
export f;
export g;
// not exported
tag t { t1; t2; }
fn f() -> t { ret t1; }
fn g(v: t) { assert (v == t1); }
}
fn main() { foo::g(foo::f()); }