From 89f183db00b14c6bfb38291c5a49a2816d840075 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 23 Oct 2016 13:47:04 +0800 Subject: MIR Gen Match - Fix test value literal type in &str --- src/mir/from_hir_match.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mir/from_hir_match.cpp b/src/mir/from_hir_match.cpp index 75c0808e..03fa64f2 100644 --- a/src/mir/from_hir_match.cpp +++ b/src/mir/from_hir_match.cpp @@ -3169,7 +3169,7 @@ void DecisionTreeGen::generate_branches_Borrow_str( auto next_bb = (&branch == &branches.back() ? default_bb : m_builder.new_bb_unlinked()); - auto test_val = m_builder.lvalue_or_temp(sp, ::HIR::TypeRef(::HIR::CoreType::Str), ::MIR::Constant(branch.first) ); + auto test_val = m_builder.lvalue_or_temp(sp, ::HIR::TypeRef::new_borrow(::HIR::BorrowType::Shared, ::HIR::CoreType::Str), ::MIR::Constant(branch.first) ); auto cmp_gt_bb = m_builder.new_bb_unlinked(); auto lt_val = m_builder.lvalue_or_temp(sp, ::HIR::CoreType::Bool, ::MIR::RValue::make_BinOp({ have_val.clone(), ::MIR::eBinOp::LT, test_val.clone() }) ); -- cgit v1.2.3