Skip to content

Commit 2d68d09

Browse files
committed
review feedback: common-subexpression-elim across functions in pushpop_safe impl.
1 parent 44bb0dd commit 2d68d09

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libsyntax/ext/pushpop_safe.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,24 @@ enum PushPop { Push, Pop }
4848

4949
pub fn expand_push_unsafe<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
5050
-> Box<base::MacResult+'cx> {
51-
feature_gate::check_for_pushpop_syntax(
52-
cx.ecfg.features, &cx.parse_sess.span_diagnostic, sp);
5351
expand_pushpop_unsafe(cx, sp, tts, PushPop::Push)
5452
}
5553

5654
pub fn expand_pop_unsafe<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
5755
-> Box<base::MacResult+'cx> {
58-
feature_gate::check_for_pushpop_syntax(
59-
cx.ecfg.features, &cx.parse_sess.span_diagnostic, sp);
6056
expand_pushpop_unsafe(cx, sp, tts, PushPop::Pop)
6157
}
6258

6359
fn expand_pushpop_unsafe<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree],
6460
pp: PushPop) -> Box<base::MacResult+'cx> {
61+
feature_gate::check_for_pushpop_syntax(
62+
cx.ecfg.features, &cx.parse_sess.span_diagnostic, sp);
63+
6564
let mut exprs = match get_exprs_from_tts(cx, sp, tts) {
6665
Some(exprs) => exprs.into_iter(),
6766
None => return DummyResult::expr(sp),
6867
};
68+
6969
let expr = match (exprs.next(), exprs.next()) {
7070
(Some(expr), None) => expr,
7171
_ => {

0 commit comments

Comments
 (0)