about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-08-14 04:41:20 -0700
committerbors <bors@rust-lang.org>2013-08-14 04:41:20 -0700
commitac49e656111cdd1727988bbbf3d3b9be554ae391 (patch)
tree34f5a3f840468e51f05827f0d228d041f0015487 /src/libsyntax
parentcd656c74f67a289bb14c7758847a0fdd2e61d9a1 (diff)
parentf3a79cf66722a917a59376b0ad60a0a370c48b8b (diff)
downloadrust-ac49e656111cdd1727988bbbf3d3b9be554ae391.tar.gz
rust-ac49e656111cdd1727988bbbf3d3b9be554ae391.zip
auto merge of #8440 : sfackler/rust/env-fix, r=pcwalton
The type of the result of option_env! was not fully specified in the
None case, leading to type check failures in the case where the variable
was not defined (e.g. option_env!("FOO").is_none()).

Also cleaned up some compilation warnings.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ext/env.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/ext/env.rs b/src/libsyntax/ext/env.rs
index c9e01b0f0d5..cb2d4f8ba24 100644
--- a/src/libsyntax/ext/env.rs
+++ b/src/libsyntax/ext/env.rs
@@ -27,7 +27,7 @@ pub fn expand_option_env(ext_cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
     let var = get_single_str_from_tts(ext_cx, sp, tts, "option_env!");
 
     let e = match os::getenv(var) {
-      None => quote_expr!(::std::option::None),
+      None => quote_expr!(::std::option::None::<&'static str>),
       Some(s) => quote_expr!(::std::option::Some($s))
     };
     MRExpr(e)