diff options
author | John Hodge <tpg@mutabah.net> | 2016-10-05 15:11:30 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-10-05 15:11:30 +0800 |
commit | 185de39f5190962bd67cdc7f9fafc9dac3c66ddd (patch) | |
tree | 59c239de3730365b3295c1893e659351e07da14c /src | |
parent | 72d662e30fb09221cc5480b1cfe6e35e725e2e33 (diff) | |
download | mrust-185de39f5190962bd67cdc7f9fafc9dac3c66ddd.tar.gz |
HIR Expand Calls - Expand _Deref for generics
Diffstat (limited to 'src')
-rw-r--r-- | src/hir_expand/ufcs_everything.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/hir_expand/ufcs_everything.cpp b/src/hir_expand/ufcs_everything.cpp index 56dc4331..9f246f74 100644 --- a/src/hir_expand/ufcs_everything.cpp +++ b/src/hir_expand/ufcs_everything.cpp @@ -627,19 +627,23 @@ namespace { ( BUG(sp, "Deref on unexpected type - " << ty_val); ), + (Generic, + ), (Path, TU_IFLET( ::HIR::Path::Data, e.path.m_data, Generic, pe, // Box<T> ("owned_box") is magical! if( pe.m_path == m_lang_Box ) { - //TODO(sp, "Deref on Box"); + // Leave as is - MIR handles this return ; } ) ), (Pointer, + // Leave as is (primitive operation) return ; ), (Borrow, + // Leave as is (primitive operation) return ; ) ) @@ -647,6 +651,7 @@ namespace { const char* langitem = nullptr; const char* method = nullptr; ::HIR::BorrowType bt; + // - Uses the value's usage beacuse for T: Copy node.m_value->m_usage is Borrow, but node.m_usage is Move switch( node.m_value->m_usage ) { case ::HIR::ValueUsage::Unknown: |