diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-10-29 22:22:12 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-10-29 22:22:12 +0800 |
commit | bf497c18ef63be9b278dd64496501077f18bb1a3 (patch) | |
tree | abf36c61b7988edbd00ce3a5cfcdf2493550f128 /src/hir_expand | |
parent | fa2a605b45a2b7c56c97feda8dd8db86eed50362 (diff) | |
download | mrust-bf497c18ef63be9b278dd64496501077f18bb1a3.tar.gz |
HIR Expand - Hacky patch to consteval
Diffstat (limited to 'src/hir_expand')
-rw-r--r-- | src/hir_expand/const_eval_full.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/hir_expand/const_eval_full.cpp b/src/hir_expand/const_eval_full.cpp index 4fd10c05..619bc9a2 100644 --- a/src/hir_expand/const_eval_full.cpp +++ b/src/hir_expand/const_eval_full.cpp @@ -341,7 +341,17 @@ namespace { return vals[ e.field_index ]; ), (Deref, - MIR_TODO(state, "LValue::Deref - " << lv); + auto& val = get_lval(*e.val); + TU_MATCH_DEF( ::HIR::Literal, (val), (ve), + ( + MIR_TODO(state, "LValue::Deref - " << lv << " { " << val << " }"); + ), + (String, + // Just clone the string (hack) + // - TODO: Create a list? + return val; + ) + ) ), (Index, auto& val = get_lval(*e.val); |