Single .rs files can access the standard library with 'use std'. See for example the run-pass/lib* tests.
Regards, Brian On Fri, Mar 11, 2011 at 8:34 AM, Marijn Haverbeke <[email protected]> wrote: > The problem (and do tell me if I missed an existing solution): The > compiler currently allows one to compile a single .rs file, but as > such a file can not open the standard library, it is only useful for > extremely trivial pieces of code. Now, not only is it very practical > to be able to write one-file crates (think Python/Perl scripts), it is > also quite annoying to have to create a crate file for every single > quick one-off test program I'm writing. > > When the compiler is invoked directly on a .rs file, we could have a > convention where, through some yet-to-be-determined syntax, the crate > spec can be embedded in the rust file. If this is well-received, I'll > gladly work out the details and implement it (it seems like something > that wouldn't really influence any components beyond the compiler > driver and the parser). > > Best, > Marijn > _______________________________________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/listinfo/rust-dev >
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
