summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2017-01-04 19:32:45 +0800
committerJohn Hodge <tpg@mutabah.net>2017-01-04 19:32:45 +0800
commit6529f81284009d916f48b51582728a23f74c2745 (patch)
treeb1f986a34ac3f3ab10678215e3df8494cf9ceba2 /src
parent622e52e7d4bd5bc5dc71dfaa84884a3a1cd0a750 (diff)
downloadmrust-6529f81284009d916f48b51582728a23f74c2745.tar.gz
MIR Gen - BinOp on str/[T] must be on pointers
Diffstat (limited to 'src')
-rw-r--r--src/mir/from_hir_match.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mir/from_hir_match.cpp b/src/mir/from_hir_match.cpp
index 3940a1c1..29eb391f 100644
--- a/src/mir/from_hir_match.cpp
+++ b/src/mir/from_hir_match.cpp
@@ -1631,7 +1631,7 @@ int MIR_LowerHIR_Match_Simple__GeneratePattern(MirBuilder& builder, const Span&
auto succ_bb = builder.new_bb_unlinked();
auto test_lval = builder.lvalue_or_temp(sp, ::HIR::TypeRef::new_borrow(::HIR::BorrowType::Shared, ty.clone()), ::MIR::RValue(::MIR::Constant( v.as_StaticString() )));
- auto cmp_lval = builder.lvalue_or_temp(sp, ::HIR::CoreType::Bool, ::MIR::RValue::make_BinOp({ val.clone(), ::MIR::eBinOp::EQ, ::MIR::LValue::make_Deref({box$(test_lval)}) }));
+ auto cmp_lval = builder.lvalue_or_temp(sp, ::HIR::CoreType::Bool, ::MIR::RValue::make_BinOp({ mv$(*val.as_Deref().val), ::MIR::eBinOp::EQ, mv$(test_lval) }));
builder.end_block( ::MIR::Terminator::make_If({ mv$(cmp_lval), succ_bb, fail_bb }) );
builder.set_cur_block(succ_bb);
} break;