summaryrefslogtreecommitdiff
path: root/src/mir/from_hir_match.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2017-01-20 19:44:47 +0800
committerJohn Hodge <tpg@mutabah.net>2017-01-20 19:44:47 +0800
commit2beb017a0c550a0979129621b826ee3c85fa72a6 (patch)
tree693f46424047a3a6d6b064b9ba7307cfce4ddbf8 /src/mir/from_hir_match.cpp
parentf095478f874b2122a98d0acd7dd1a59293799a94 (diff)
downloadmrust-2beb017a0c550a0979129621b826ee3c85fa72a6.tar.gz
MIR - Drop flags (incomplete, doesn't pass validation)
Diffstat (limited to 'src/mir/from_hir_match.cpp')
-rw-r--r--src/mir/from_hir_match.cpp20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/mir/from_hir_match.cpp b/src/mir/from_hir_match.cpp
index f5e083bf..0e1a94aa 100644
--- a/src/mir/from_hir_match.cpp
+++ b/src/mir/from_hir_match.cpp
@@ -221,19 +221,6 @@ void MIR_LowerHIR_Match( MirBuilder& builder, MirConverter& conv, ::HIR::ExprNod
}
};
- bool has_move_pattern = false;
- for(const auto& arm : node.m_arms)
- {
- for(const auto& pat : arm.m_patterns)
- {
- has_move_pattern |= H::is_pattern_move(node.span(), builder, pat);
- if( has_move_pattern )
- break ;
- }
- if( has_move_pattern )
- break ;
- }
-
auto match_scope = builder.new_scope_split(node.span());
// Map of arm index to ruleset
@@ -277,13 +264,6 @@ void MIR_LowerHIR_Match( MirBuilder& builder, MirConverter& conv, ::HIR::ExprNod
}
builder.terminate_scope( arm.m_code->span(), mv$(pat_scope) );
- // TODO: If this pattern ignores fields with Drop impls, this will lead to leaks.
- // - Ideally, this would trigger a drop of whatever wasn't already taken by the pattern.
- if( has_move_pattern )
- {
- builder.moved_lvalue(node.span(), match_val);
- }
-
// Condition
// NOTE: Lack of drop due to early exit from this arm isn't an issue. All captures must be Copy
// - The above is rustc E0008 "cannot bind by-move into a pattern guard"