Register new snapshots

This commit is contained in:
Alex Crichton 2013-09-16 23:34:40 -07:00
parent e02313a172
commit 817576ee70
32 changed files with 32 additions and 1663 deletions

View file

@ -644,25 +644,11 @@ impl AstBuilder for @ExtCtxt {
self.expr(span, ast::ExprFnBlock(fn_decl, blk))
}
#[cfg(stage0)]
fn lambda0(&self, _span: Span, blk: ast::Block) -> @ast::Expr {
let ext_cx = *self;
let blk_e = self.expr(blk.span, ast::ExprBlock(blk.clone()));
quote_expr!(|| $blk_e )
}
#[cfg(not(stage0))]
fn lambda0(&self, _span: Span, blk: ast::Block) -> @ast::Expr {
let blk_e = self.expr(blk.span, ast::ExprBlock(blk.clone()));
quote_expr!(*self, || $blk_e )
}
#[cfg(stage0)]
fn lambda1(&self, _span: Span, blk: ast::Block, ident: ast::Ident) -> @ast::Expr {
let ext_cx = *self;
let blk_e = self.expr(blk.span, ast::ExprBlock(blk.clone()));
quote_expr!(|$ident| $blk_e )
}
#[cfg(not(stage0))]
fn lambda1(&self, _span: Span, blk: ast::Block, ident: ast::Ident) -> @ast::Expr {
let blk_e = self.expr(blk.span, ast::ExprBlock(blk.clone()));
quote_expr!(*self, |$ident| $blk_e )

View file

@ -22,18 +22,6 @@ use ext::build::AstBuilder;
use std::os;
#[cfg(stage0)]
pub fn expand_option_env(ext_cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree])
-> base::MacResult {
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::<&'static str>),
Some(s) => quote_expr!(::std::option::Some($s))
};
MRExpr(e)
}
#[cfg(not(stage0))]
pub fn expand_option_env(cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree])
-> base::MacResult {
let var = get_single_str_from_tts(cx, sp, tts, "option_env!");

View file

@ -863,9 +863,7 @@ pub fn std_macros() -> @str {
use super::*;
static key: ::std::local_data::Key<
@::std::condition::Handler<$input, $out>> =
&::std::local_data::Key;
local_data_key!(key: @::std::condition::Handler<$input, $out>)
pub static cond :
::std::condition::Condition<$input,$out> =
@ -884,9 +882,7 @@ pub fn std_macros() -> @str {
use super::*;
static key: ::std::local_data::Key<
@::std::condition::Handler<$input, $out>> =
&::std::local_data::Key;
local_data_key!(key: @::std::condition::Handler<$input, $out>)
pub static cond :
::std::condition::Condition<$input,$out> =
@ -975,8 +971,6 @@ pub fn std_macros() -> @str {
($($arg:tt)*) => (::std::io::println(format!($($arg)*)))
)
// NOTE: use this after a snapshot lands to abstract the details
// of the TLS interface.
macro_rules! local_data_key (
($name:ident: $ty:ty) => (
static $name: ::std::local_data::Key<$ty> = &::std::local_data::Key;