diff options
-rw-r--r-- | src/hir_typeck/expr_cs.cpp | 2 | ||||
-rw-r--r-- | src/mir/from_hir.cpp | 4 | ||||
-rw-r--r-- | src/mir/from_hir_match.cpp | 2 | ||||
-rw-r--r-- | src/mir/mir_builder.cpp | 6 |
4 files changed, 9 insertions, 5 deletions
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp index 3c3f6e71..e8e0f65c 100644 --- a/src/hir_typeck/expr_cs.cpp +++ b/src/hir_typeck/expr_cs.cpp @@ -3881,7 +3881,7 @@ void Context::handle_pattern(const Span& sp, ::HIR::Pattern& pat, const ::HIR::T } TU_ARM(pattern.m_data, Value, pe) { // no-op? - if( pe.val.is_String() ) { + if( pe.val.is_String() || pe.val.is_ByteString() ) { ASSERT_BUG(sp, pattern.m_implicit_deref_count >= 1, ""); pattern.m_implicit_deref_count -= 1; } diff --git a/src/mir/from_hir.cpp b/src/mir/from_hir.cpp index c3281bd6..38d00a5a 100644 --- a/src/mir/from_hir.cpp +++ b/src/mir/from_hir.cpp @@ -1218,7 +1218,7 @@ namespace { } void visit(::HIR::ExprNode_Cast& node) override { - TRACE_FUNCTION_F("_Cast"); + TRACE_FUNCTION_F("_Cast " << node.m_res_type); this->visit_node_ptr(node.m_value); const auto& ty_out = node.m_res_type; @@ -2009,7 +2009,7 @@ namespace { } void visit(::HIR::ExprNode_Field& node) override { - TRACE_FUNCTION_F("_Field"); + TRACE_FUNCTION_F("_Field \"" << node.m_field << "\""); this->visit_node_ptr(node.m_value); auto val = m_builder.get_result_in_lvalue(node.m_value->span(), node.m_value->m_res_type); diff --git a/src/mir/from_hir_match.cpp b/src/mir/from_hir_match.cpp index 8014ea8e..264c74c5 100644 --- a/src/mir/from_hir_match.cpp +++ b/src/mir/from_hir_match.cpp @@ -1119,7 +1119,7 @@ void PatternRulesetBuilder::append_from(const Span& sp, const ::HIR::Pattern& pa (Any, // _ on a box, recurse into the box type. m_field_path.push_back(FIELD_DEREF); - this->append_from(sp, pat, inner_ty); + this->append_from(sp, empty_pattern, inner_ty); m_field_path.pop_back(); ), (Box, diff --git a/src/mir/mir_builder.cpp b/src/mir/mir_builder.cpp index a3650919..ac1b7650 100644 --- a/src/mir/mir_builder.cpp +++ b/src/mir/mir_builder.cpp @@ -290,7 +290,11 @@ void MirBuilder::push_stmt_assign(const Span& sp, ::MIR::LValue dst, ::MIR::RVal } ), (Cast, - this->moved_lvalue(sp, e.val); + // TODO: Does this actually move? + if( e.type.m_data.is_Borrow() ) + { + this->moved_lvalue(sp, e.val); + } ), (BinOp, switch(e.op) |