diff options
author | John Hodge <tpg@mutabah.net> | 2016-11-19 17:32:16 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-11-19 17:32:16 +0800 |
commit | 82a7cd1be6e73d7c8fc40a552120e9e34a92f9db (patch) | |
tree | 67191ec98090b663f76c4d6fdbc66aa043c34405 | |
parent | 4e3dc23183a60bff383f8ed228d8fecd18d7ac0a (diff) | |
download | mrust-82a7cd1be6e73d7c8fc40a552120e9e34a92f9db.tar.gz |
MIR Gen Match - Fix bad type for string in simple
-rw-r--r-- | src/mir/from_hir_match.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mir/from_hir_match.cpp b/src/mir/from_hir_match.cpp index 2c7ffcc7..860bb5bb 100644 --- a/src/mir/from_hir_match.cpp +++ b/src/mir/from_hir_match.cpp @@ -1444,8 +1444,8 @@ 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, 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, mv$(test_lval) })); + 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)}) })); builder.end_block( ::MIR::Terminator::make_If({ mv$(cmp_lval), succ_bb, fail_bb }) ); builder.set_cur_block(succ_bb); } break; |