diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-02-12 11:30:16 +0100 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-07-22 15:33:59 +0200 |
| commit | b325e4f28e0735bb951bdf9f1db1206bd3ee715b (patch) | |
| tree | 85936fe4b2c7a27c44ceaf8b48149adb577c920b /src/libsyntax/ext | |
| parent | d79bbbc4ef20a11680a004b600a90281e4c5e04a (diff) | |
| download | rust-b325e4f28e0735bb951bdf9f1db1206bd3ee715b.tar.gz rust-b325e4f28e0735bb951bdf9f1db1206bd3ee715b.zip | |
Add feature-gates for desugaring-based `box` and placement-`in`.
update test/compile-fail/feature-gate-box-expr.rs to reflect new feature gates. Part of what lands with Issue 22181.
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 208446ed046..93e744287ba 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -56,6 +56,7 @@ pub fn expand_expr(e: P<ast::Expr>, fld: &mut MacroExpander) -> P<ast::Expr> { }); } + let expr_span = e.span; return e.and_then(|ast::Expr {id, node, span}| match node { // expr_mac should really be expr_ext or something; it's the @@ -94,6 +95,12 @@ pub fn expand_expr(e: P<ast::Expr>, fld: &mut MacroExpander) -> P<ast::Expr> { // InPlace::finalize(place) // }) + // Ensure feature-gate is enabled + feature_gate::check_for_placement_in( + fld.cx.ecfg.features, + &fld.cx.parse_sess.span_diagnostic, + expr_span); + let value_span = value_expr.span; let placer_span = placer.span; |
