summaryrefslogtreecommitdiff
path: root/src/mir/from_hir.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-09-07 09:57:01 +0800
committerJohn Hodge <tpg@mutabah.net>2016-09-07 09:57:01 +0800
commitd47803233fdc6a5576d5eb9f4495bce61f42ff7a (patch)
tree5e2137126b4756927a11cfc85ee74fb7cd5ad262 /src/mir/from_hir.cpp
parent84f82d42a8bd56f1f9dbd62d9d0255554002d315 (diff)
downloadmrust-d47803233fdc6a5576d5eb9f4495bce61f42ff7a.tar.gz
MIR Gen - Cleaner Box support, start on move-out structure
Diffstat (limited to 'src/mir/from_hir.cpp')
-rw-r--r--src/mir/from_hir.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/mir/from_hir.cpp b/src/mir/from_hir.cpp
index 5a0ca03a..59714d8b 100644
--- a/src/mir/from_hir.cpp
+++ b/src/mir/from_hir.cpp
@@ -1008,17 +1008,11 @@ namespace {
TU_MATCH_DEF( ::HIR::TypeRef::Data, (ty_val.m_data), (te),
(
- if( m_builder.lang_Box() )
+ if( m_builder.is_type_owned_box( ty_val ) )
{
- if( ty_val.m_data.is_Path()
- && ty_val.m_data.as_Path().path.m_data.is_Generic()
- && ty_val.m_data.as_Path().path.m_data.as_Generic().m_path == *m_builder.lang_Box()
- )
- {
- // Box magically derefs.
- // HACK: Break out of the switch used for TU_MATCH_DEF
- break;
- }
+ // Box magically derefs.
+ // HACK: Break out of the switch used for TU_MATCH_DEF
+ break;
}
BUG(sp, "Deref on unsupported type - " << ty_val);
),