summaryrefslogtreecommitdiff
path: root/Notes/BoxOperator.md
diff options
context:
space:
mode:
Diffstat (limited to 'Notes/BoxOperator.md')
-rw-r--r--Notes/BoxOperator.md36
1 files changed, 36 insertions, 0 deletions
diff --git a/Notes/BoxOperator.md b/Notes/BoxOperator.md
new file mode 100644
index 00000000..33e30268
--- /dev/null
+++ b/Notes/BoxOperator.md
@@ -0,0 +1,36 @@
+% `box` and `in` operators
+
+See: https://github.com/rust-lang/rfcs/pull/1426#r48383364
+
+Structures
+=========
+
+AST
+---
+
+UniOp for `box` and BinOp for `in` and `<-`
+
+
+HIR
+---
+
+```c++
+struct ExprNode_Emplace
+{
+ enum class Type {
+ Placer,
+ Boxer,
+ };
+
+ Type m_type;
+ ExprNodeP m_place;
+ ExprNodeP m_value;
+}
+```
+
+
+Type Inferrence
+===============
+
+The `_Emplace` node type has a revisit to obtain the expected result type.
+