rust/src/etc
Alex Crichton 70ed3a48df std: Add a new env module
This is an implementation of [RFC 578][rfc] which adds a new `std::env` module
to replace most of the functionality in the current `std::os` module. More
details can be found in the RFC itself, but as a summary the following methods
have all been deprecated:

[rfc]: https://github.com/rust-lang/rfcs/pull/578

* `os::args_as_bytes`   => `env::args`
* `os::args`            => `env::args`
* `os::consts`          => `env::consts`
* `os::dll_filename`    => no replacement, use `env::consts` directly
* `os::page_size`       => `env::page_size`
* `os::make_absolute`   => use `env::current_dir` + `join` instead
* `os::getcwd`          => `env::current_dir`
* `os::change_dir`      => `env::set_current_dir`
* `os::homedir`         => `env::home_dir`
* `os::tmpdir`          => `env::temp_dir`
* `os::join_paths`      => `env::join_paths`
* `os::split_paths`     => `env::split_paths`
* `os::self_exe_name`   => `env::current_exe`
* `os::self_exe_path`   => use `env::current_exe` + `pop`
* `os::set_exit_status` => `env::set_exit_status`
* `os::get_exit_status` => `env::get_exit_status`
* `os::env`             => `env::vars`
* `os::env_as_bytes`    => `env::vars`
* `os::getenv`          => `env::var` or `env::var_string`
* `os::getenv_as_bytes` => `env::var`
* `os::setenv`          => `env::set_var`
* `os::unsetenv`        => `env::remove_var`

Many function signatures have also been tweaked for various purposes, but the
main changes were:

* `Vec`-returning APIs now all return iterators instead
* All APIs are now centered around `OsString` instead of `Vec<u8>` or `String`.
  There is currently on convenience API, `env::var_string`, which can be used to
  get the value of an environment variable as a unicode `String`.

All old APIs are `#[deprecated]` in-place and will remain for some time to allow
for migrations. The semantics of the APIs have been tweaked slightly with regard
to dealing with invalid unicode (panic instead of replacement).

The new `std::env` module is all contained within the `env` feature, so crates
must add the following to access the new APIs:

    #![feature(env)]

[breaking-change]
2015-02-01 11:08:15 -08:00
..
mingw-fix-include Added more scripts to tidy check 2014-02-17 10:36:47 -06:00
third-party Update license notice. 2014-09-11 09:40:20 -07:00
2014-06-rewrite-bytes-macros.py Change /bin/env to /usr/bin/env in helper python script, as it is more portable 2014-06-23 09:17:40 +10:00
adb_run_wrapper.sh Added more scripts to tidy check 2014-02-17 10:36:47 -06:00
apple-darwin.supp platform-specific valgrind suppression 2012-02-05 09:07:23 -08:00
check-binaries.py add shebang to scripts that have execute bit set 2014-05-12 19:52:29 -07:00
check-summary.py Fix PEP8 for check-summary.py 2015-01-27 01:26:02 -08:00
cmathconsts.c Added more scripts to tidy check 2014-02-17 10:36:47 -06:00
ctags.rust Improved the tags impl regex 2014-07-24 09:08:52 -04:00
errorck.py Fix PEP8 for errorck 2015-01-27 01:26:02 -08:00
extract_grammar.py Fix PEP8 for extract_grammar 2015-01-27 01:26:03 -08:00
featureck.py featurkck: Typo 2015-01-25 01:25:59 -08:00
gdb_load_rust_pretty_printers.py debuginfo: Add a rust-gdb shell script that will start GDB with Rust pretty printers enabled. 2014-12-30 17:26:13 +01:00
gdb_rust_pretty_printing.py Fix PEP8 in gdb pretty printer 2015-01-27 01:09:38 -08:00
generate-deriving-span-tests.py s/deriving/derives in Comments/Docs 2015-01-17 11:08:02 -08:00
generate-keyword-tests.py Fix PEP8 for generate-keyword-tests 2015-01-27 01:26:03 -08:00
get-snapshot.py Fix PEP8 in snapshot.py 2015-01-27 01:26:02 -08:00
htmldocck.py Fix PEP8 for htmldocck 2015-01-27 01:26:03 -08:00
indenter Port indenter to python 2015-01-16 08:49:54 -08:00
latest-unix-snaps.py Fix PEP8 for latest-unix-snaps.py 2015-01-27 01:26:03 -08:00
libc.c Added more scripts to tidy check 2014-02-17 10:36:47 -06:00
licenseck.py Use a regex to perform license check 2015-01-22 23:04:14 -08:00
lldb_batchmode.py Fix PEP8 in lldb_batchmode.py 2015-01-27 01:25:54 -08:00
lldb_rust_formatters.py Fix PEP8 in lldb_rust_formatters.py 2015-01-27 01:25:54 -08:00
local_stage0.sh shell 'case' statement don't need 'break' 2015-01-26 08:32:34 +01:00
make-snapshot.py add shebang to scripts that have execute bit set 2014-05-12 19:52:29 -07:00
make-win-dist.py std: Add a new env module 2015-02-01 11:08:15 -08:00
maketest.py Fix PEP8 in maketest 2015-01-27 01:26:01 -08:00
mirror-all-snapshots.py Fix PEP8 in mirror-all-snapshots 2015-01-27 01:26:03 -08:00
mklldeps.py Fix PEP8 in snapshot.py 2015-01-27 01:26:02 -08:00
regex-match-tests.py librustc: Always parse macro!()/macro![] as expressions if not 2014-12-18 12:09:07 -05:00
rust-gdb debuginfo: Add a rust-gdb shell script that will start GDB with Rust pretty printers enabled. 2014-12-30 17:26:13 +01:00
rust-lldb rustc: Start "stabilizing" some flags 2014-12-19 11:38:24 -08:00
rustup.sh rollup merge of #21274: estsauver/21270 2015-01-21 09:13:43 -08:00
snapshot.py Fix PEP8 in snapshot.py 2015-01-27 01:26:02 -08:00
sugarise-doc-comments.py Fix PEP8 in sugarise-doc-comments 2015-01-27 01:26:02 -08:00
tidy.py Fix PEP8 for tidy 2015-01-27 01:26:13 -08:00
unicode.py cleanup: s/impl Copy/#[derive(Copy)]/g 2015-01-25 11:20:38 -05:00
x86.supp rm obsolete valgrind suppressions 2014-10-02 05:01:10 -04:00
ziggurat_tables.py std: Move rand to librand. 2014-03-12 11:31:05 +11:00