diff options
Diffstat (limited to 'src/mir/from_hir.cpp')
-rw-r--r-- | src/mir/from_hir.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/mir/from_hir.cpp b/src/mir/from_hir.cpp index e8e72b9c..ba3acc51 100644 --- a/src/mir/from_hir.cpp +++ b/src/mir/from_hir.cpp @@ -650,18 +650,11 @@ namespace { this->visit_node_ptr(node.m_value); auto ptr_lval = m_builder.lvalue_or_temp( node.m_value->m_res_type, m_builder.get_result(node.span()) ); - if( !node.m_res_type.m_data.is_Borrow() ) { - BUG(node.span(), "MIR _Unsize with invalid type, requires output to be &-ptr, got " << node.m_res_type); - } - if( !node.m_value->m_res_type.m_data.is_Borrow() ) { - BUG(node.span(), "MIR _Unsize with invalid type, requires input to be &-ptr, got " << node.m_value->m_res_type); - } - const auto& ty_out = *node.m_res_type.m_data.as_Borrow().inner; - const auto& ty_in = *node.m_value->m_res_type.m_data.as_Borrow().inner; - + const auto& ty_out = node.m_res_type; + const auto& ty_in = node.m_value->m_res_type; TU_MATCH_DEF( ::HIR::TypeRef::Data, (ty_out.m_data), (e), ( - TODO(node.span(), "MIR _Unsize to &[mut] " << ty_out); + TODO(node.span(), "MIR _Unsize to " << ty_out); ), // TODO: Unsize custom types containing a ?Size generic - See the Unsize trait //(Path, |