From f3a79cf66722a917a59376b0ad60a0a370c48b8b Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sat, 10 Aug 2013 11:09:30 -0700 Subject: Fixed option_env! type 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()). --- src/libsyntax/ext/env.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsyntax') 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) -- cgit 1.4.1-3-g733a5