summaryrefslogtreecommitdiff
path: root/src/mir/cleanup.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2019-01-04 22:04:30 +0800
committerJohn Hodge <tpg@ucc.asn.au>2019-01-04 22:04:30 +0800
commit0763219c6c2b29fba23646384e386bbefa094584 (patch)
tree31fed2319e798f0497c5d79c2690d21dd3c53bf5 /src/mir/cleanup.cpp
parentd681c0cfa1077e4646a292695b6a7426f2056414 (diff)
downloadmrust-0763219c6c2b29fba23646384e386bbefa094584.tar.gz
Constant Evaluate - More handling of Defer constants
Diffstat (limited to 'src/mir/cleanup.cpp')
-rw-r--r--src/mir/cleanup.cpp2
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));