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.
This commit is contained in:
Felix S. Klock II
2015-02-12 11:30:16 +01:00
parent d79bbbc4ef
commit b325e4f28e
5 changed files with 70 additions and 2 deletions

View File

@@ -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;