diff options
author | John Hodge <tpg@ucc.asn.au> | 2019-01-04 22:04:30 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2019-01-04 22:04:30 +0800 |
commit | 0763219c6c2b29fba23646384e386bbefa094584 (patch) | |
tree | 31fed2319e798f0497c5d79c2690d21dd3c53bf5 /src/mir/cleanup.cpp | |
parent | d681c0cfa1077e4646a292695b6a7426f2056414 (diff) | |
download | mrust-0763219c6c2b29fba23646384e386bbefa094584.tar.gz |
Constant Evaluate - More handling of Defer constants
Diffstat (limited to 'src/mir/cleanup.cpp')
-rw-r--r-- | src/mir/cleanup.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mir/cleanup.cpp b/src/mir/cleanup.cpp index f3e987d6..fdc0f3d4 100644 --- a/src/mir/cleanup.cpp +++ b/src/mir/cleanup.cpp @@ -1093,7 +1093,7 @@ void MIR_Cleanup(const StaticTraitResolve& resolve, const ::HIR::ItemPath& path, // 1. Find the constant ::HIR::TypeRef ty; const auto* lit_ptr = MIR_Cleanup_GetConstant(state, ce.p, ty); - if( lit_ptr ) + if( lit_ptr && !lit_ptr->is_Defer() ) { DEBUG("Replace constant " << ce.p << " with " << *lit_ptr); se.src = MIR_Cleanup_LiteralToRValue(state, mutator, *lit_ptr, mv$(ty), mv$(ce.p)); |