cx.ident_of("Default"),
cx.ident_of("default")
);
- let default_call = |span| cx.expr_call_global(span, default_ident.clone(), Vec::new());
+ let default_call = |&: span| cx.expr_call_global(span, default_ident.clone(), Vec::new());
return match *substr.fields {
StaticStruct(_, ref summary) => {
// where each tuple has length = self_args.len()
let mut match_arms: Vec<ast::Arm> = variants.iter().enumerate()
.map(|(index, variant)| {
- let mk_self_pat = |cx: &mut ExtCtxt, self_arg_name: &str| {
+ let mk_self_pat = |&: cx: &mut ExtCtxt, self_arg_name: &str| {
let (p, idents) = trait_.create_enum_variant_pattern(cx, type_ident,
&**variant,
self_arg_name,
_ => cx.span_bug(trait_span, "incorrect number of arguments in `deriving(Hash)`")
};
let hash_ident = substr.method_ident;
- let call_hash = |span, thing_expr| {
+ let call_hash = |&: span, thing_expr| {
let expr = cx.expr_method_call(span, thing_expr, hash_ident, vec!(state_expr.clone()));
cx.stmt_expr(expr)
};
cx.ident_of("Zero"),
cx.ident_of("zero")
);
- let zero_call = |span| cx.expr_call_global(span, zero_ident.clone(), Vec::new());
+ let zero_call = |&: span| cx.expr_call_global(span, zero_ident.clone(), Vec::new());
return match *substr.fields {
StaticStruct(_, ref summary) => {
assert!((shouldmatch.len() == 0) ||
(varrefs.len() > *shouldmatch.iter().max().unwrap()));
for (idx,varref) in varrefs.iter().enumerate() {
- let print_hygiene_debug_info = || {
+ let print_hygiene_debug_info = |&:| {
// good lord, you can't make a path with 0 segments, can you?
let final_varref_ident = match varref.segments.last() {
Some(pathsegment) => pathsegment.identifier,
tts: &[ast::TokenTree]) -> P<ast::Expr> {
let (cx_expr, tts_expr) = expand_tts(cx, sp, tts);
- let cfg_call = || cx.expr_method_call(
+ let cfg_call = |&:| cx.expr_method_call(
sp, cx.expr_ident(sp, id_ext("ext_cx")),
id_ext("cfg"), Vec::new());
- let parse_sess_call = || cx.expr_method_call(
+ let parse_sess_call = |&:| cx.expr_method_call(
sp, cx.expr_ident(sp, id_ext("ext_cx")),
id_ext("parse_sess"), Vec::new());
/// add the path to the session's codemap and return the new filemap.
pub fn file_to_filemap(sess: &ParseSess, path: &Path, spanopt: Option<Span>)
-> Rc<FileMap> {
- let err = |msg: &str| {
+ let err = |&: msg: &str| {
match spanopt {
Some(sp) => sess.span_diagnostic.span_fatal(sp, msg),
None => sess.span_diagnostic.handler().fatal(msg),
.map(|x| (x, len as int))
}
- let unicode_escape: || -> Option<(char, int)> = ||
+ let unicode_escape = |&: | -> Option<(char, int)>
if lit.as_bytes()[2] == b'{' {
let idx = lit.find('}').expect(msg2);
let subslice = lit[3..idx];
let mut res = String::with_capacity(lit.len());
// FIXME #8372: This could be a for-loop if it didn't borrow the iterator
- let error = |i| format!("lexer should have rejected {} at {}", lit, i);
+ let error = |&: i| format!("lexer should have rejected {} at {}", lit, i);
/// Eat everything up to a non-whitespace
fn eat<'a>(it: &mut iter::Peekable<(uint, char), str::CharIndices<'a>>) {
/// Parse a string representing a byte literal into its final form. Similar to `char_lit`
pub fn byte_lit(lit: &str) -> (u8, uint) {
- let err = |i| format!("lexer accepted invalid byte literal {} step {}", lit, i);
+ let err = |&: i| format!("lexer accepted invalid byte literal {} step {}", lit, i);
if lit.len() == 1 {
(lit.as_bytes()[0], 1)
let mut res = Vec::with_capacity(lit.len());
// FIXME #8372: This could be a for-loop if it didn't borrow the iterator
- let error = |i| format!("lexer should have rejected {} at {}", lit, i);
+ let error = |&: i| format!("lexer should have rejected {} at {}", lit, i);
/// Eat everything up to a non-whitespace
fn eat<'a, I: Iterator<(uint, u8)>>(it: &mut iter::Peekable<(uint, u8), I>) {
let test_id = ecx.ident_of("test");
// creates self::test::$name
- let test_path = |name| {
+ let test_path = |&: name| {
ecx.path(span, vec![self_id, test_id, ecx.ident_of(name)])
};
// creates $name: $expr
- let field = |name, expr| ecx.field_imm(span, ecx.ident_of(name), expr);
+ let field = |&: name, expr| ecx.field_imm(span, ecx.ident_of(name), expr);
debug!("encoding {}", ast_util::path_name_i(path[]));
vec![name_expr]);
let ignore_expr = ecx.expr_bool(span, test.ignore);
- let should_fail_path = |name| {
+ let should_fail_path = |&: name| {
ecx.path(span, vec![self_id, test_id, ecx.ident_of("ShouldFail"), ecx.ident_of(name)])
};
let fail_expr = match test.should_fail {