]> git.lizzy.rs Git - rust.git/commit
auto merge of #8362 : sfackler/rust/env, r=alexcrichton
authorbors <bors@rust-lang.org>
Fri, 9 Aug 2013 12:35:06 +0000 (05:35 -0700)
committerbors <bors@rust-lang.org>
Fri, 9 Aug 2013 12:35:06 +0000 (05:35 -0700)
commit6928a10e3f606c3e9e8b94947489244f0e542876
tree75c6623ff2651debff3c938efa80aaf00aeacb07
parent2fe2e59c67842b37de212bf63466b6280c2bf498
parentc3825c835197a97ff4f254802efde80335d3833b
auto merge of #8362 : sfackler/rust/env, r=alexcrichton

env! aborts compilation of the specified environment variable is not
defined and takes an optional second argument containing a custom
error message. option_env! creates an Option<&'static str> containing
the value of the environment variable.

There are no run-pass tests that check the behavior when the environment
variable is defined since the test framework doesn't support setting
environment variables at compile time as opposed to runtime. However,
both env! and option_env! are used inside of rustc itself, which should
act as a sufficient test.

Fixes #2248.
src/librustc/driver/driver.rs
src/librustc/middle/resolve.rs
src/librustc/rustc.rs
src/libsyntax/ext/base.rs