Revert "Change fold_tt and fold_tts to take token trees by value (instead of by reference)"

This reverts commit 5bf7970ac7.
This commit is contained in:
Jeffrey Seyfried
2016-07-04 10:25:50 +00:00
parent c2b56fb7a0
commit 547a930835
8 changed files with 72 additions and 53 deletions

View File

@@ -237,7 +237,7 @@ fn expand_mac_invoc<T>(mac: ast::Mac, ident: Option<Ident>, attrs: Vec<ast::Attr
},
});
let marked_tts = mark_tts(tts, mark);
let marked_tts = mark_tts(&tts, mark);
Some(expandfun.expand(fld.cx, call_site, &marked_tts))
}
@@ -257,7 +257,7 @@ fn expand_mac_invoc<T>(mac: ast::Mac, ident: Option<Ident>, attrs: Vec<ast::Attr
}
});
let marked_tts = mark_tts(tts, mark);
let marked_tts = mark_tts(&tts, mark);
Some(expander.expand(fld.cx, call_site, ident, marked_tts))
}
@@ -1126,7 +1126,7 @@ impl Folder for Marker {
Spanned {
node: Mac_ {
path: self.fold_path(node.path),
tts: self.fold_tts(node.tts),
tts: self.fold_tts(&node.tts),
},
span: self.new_span(span),
}
@@ -1141,7 +1141,7 @@ impl Folder for Marker {
}
// apply a given mark to the given token trees. Used prior to expansion of a macro.
fn mark_tts(tts: Vec<TokenTree>, m: Mrk) -> Vec<TokenTree> {
fn mark_tts(tts: &[TokenTree], m: Mrk) -> Vec<TokenTree> {
noop_fold_tts(tts, &mut Marker{mark:m, expn_id: None})
}