diff options
author | John Hodge <tpg@mutabah.net> | 2016-12-11 08:50:37 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-12-11 08:50:37 +0800 |
commit | b556656fc9141c2d157b8da8fc95adaa16683e40 (patch) | |
tree | 813e24b55ec26c43b443abe54e043d313db79c23 /src/mir/from_hir.cpp | |
parent | ac499f7f9eee32e751334e96d0d0bf2bb68b1b8f (diff) | |
download | mrust-b556656fc9141c2d157b8da8fc95adaa16683e40.tar.gz |
MIR Cleanup - Hackily handle borrowing a DST from within a type
Diffstat (limited to 'src/mir/from_hir.cpp')
-rw-r--r-- | src/mir/from_hir.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mir/from_hir.cpp b/src/mir/from_hir.cpp index 14df55c6..75ff1619 100644 --- a/src/mir/from_hir.cpp +++ b/src/mir/from_hir.cpp @@ -1833,7 +1833,7 @@ namespace { } -::MIR::FunctionPointer LowerMIR(const StaticTraitResolve& resolve, const ::HIR::ExprPtr& ptr, const ::HIR::Function::args_t& args) +::MIR::FunctionPointer LowerMIR(const StaticTraitResolve& resolve, const ::HIR::ItemPath& path, const ::HIR::ExprPtr& ptr, const ::HIR::Function::args_t& args) { TRACE_FUNCTION; @@ -1862,7 +1862,7 @@ namespace { } ::HIR::TypeRef ret; - MIR_Cleanup(resolve, ::HIR::ItemPath(), fcn, args, ret); + MIR_Cleanup(resolve, path, fcn, args, ret); return ::MIR::FunctionPointer(new ::MIR::Function(mv$(fcn))); } @@ -1889,7 +1889,7 @@ namespace { this->visit_type( *e.inner ); DEBUG("Array size " << ty); if( e.size ) { - auto fcn = LowerMIR(m_resolve, *e.size, {}); + auto fcn = LowerMIR(m_resolve, ::HIR::ItemPath(), *e.size, {}); e.size->m_mir = mv$(fcn); } ) @@ -1906,7 +1906,7 @@ namespace { if( item.m_code ) { DEBUG("Function code " << p); - item.m_code.m_mir = LowerMIR(m_resolve, item.m_code, item.m_args); + item.m_code.m_mir = LowerMIR(m_resolve, p, item.m_code, item.m_args); } else { @@ -1917,14 +1917,14 @@ namespace { if( item.m_value ) { DEBUG("`static` value " << p); - item.m_value.m_mir = LowerMIR(m_resolve, item.m_value, {}); + item.m_value.m_mir = LowerMIR(m_resolve, p, item.m_value, {}); } } void visit_constant(::HIR::ItemPath p, ::HIR::Constant& item) override { if( item.m_value ) { DEBUG("`const` value " << p); - item.m_value.m_mir = LowerMIR(m_resolve, item.m_value, {}); + item.m_value.m_mir = LowerMIR(m_resolve, p, item.m_value, {}); } } void visit_enum(::HIR::ItemPath p, ::HIR::Enum& item) override { @@ -1932,7 +1932,7 @@ namespace { for(auto& var : item.m_variants) { TU_IFLET(::HIR::Enum::Variant, var.second, Value, e, - e.expr.m_mir = LowerMIR(m_resolve, e.expr, {}); + e.expr.m_mir = LowerMIR(m_resolve, p + var.first, e.expr, {}); ) } } |