diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-09-04 14:48:01 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-09-04 14:48:01 +0800 |
commit | 097f036747d0b99c6d9d2744190c614c02bbb388 (patch) | |
tree | 84f4f0be1e964ace4145eecb5113d207fe0b617b /src/hir | |
parent | 3e511bbd5af436e1c757ee68f8af409c0e66ed43 (diff) | |
download | mrust-097f036747d0b99c6d9d2744190c614c02bbb388.tar.gz |
All - Placement new (<-) syntax
Diffstat (limited to 'src/hir')
-rw-r--r-- | src/hir/from_ast_expr.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/hir/from_ast_expr.cpp b/src/hir/from_ast_expr.cpp index 46cb03b5..a98140d7 100644 --- a/src/hir/from_ast_expr.cpp +++ b/src/hir/from_ast_expr.cpp @@ -124,7 +124,11 @@ struct LowerHIR_ExprNode_Visitor: BUG(v.span(), "Unexpected RANGE_INC binop"); break; } case ::AST::ExprNode_BinOp::PLACE_IN: - TODO(v.span(), "Desugar placement syntax"); + m_rv.reset(new ::HIR::ExprNode_Emplace(v.span(), + ::HIR::ExprNode_Emplace::Type::Placer, + LowerHIR_ExprNode_Inner(*v.m_left), + LowerHIR_ExprNode_Inner(*v.m_right) + )); break; case ::AST::ExprNode_BinOp::CMPEQU : op = ::HIR::ExprNode_BinOp::Op::CmpEqu ; if(0) @@ -160,11 +164,8 @@ struct LowerHIR_ExprNode_Visitor: switch(v.m_type) { case ::AST::ExprNode_UniOp::BOX: { - // TODO: Emit a call to `<_ as "core"::default::Default>::default()` in place of the nullptr - auto path_Default = ::HIR::GenericPath( ::HIR::SimplePath(g_core_crate, {"default", "Default"}) ); m_rv.reset(new ::HIR::ExprNode_Emplace(v.span(), ::HIR::ExprNode_Emplace::Type::Boxer, - //::HIR::ExprNodeP(new ::HIR::ExprNode_CallPath(v.span(), ::HIR::Path(::HIR::TypeRef(), mv$(path_Default), "default"), {} )), ::HIR::ExprNodeP(new ::HIR::ExprNode_Tuple(v.span(), {})), LowerHIR_ExprNode_Inner(*v.m_value) )); |