summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-09-15 10:50:34 +0800
committerJohn Hodge <tpg@mutabah.net>2016-09-15 10:50:34 +0800
commit46f08d7173f621884c44003e5d730d7118fb0881 (patch)
tree63bdd81b91da1e513735d5b249165c0f57f142a6
parent2c1b3f5f1d83ba4e52922cfd666b251c2d3e2d5e (diff)
downloadmrust-46f08d7173f621884c44003e5d730d7118fb0881.tar.gz
Typecheck Expr - Fix some comments
-rw-r--r--src/hir_typeck/expr_cs.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp
index fdb5c8e9..529a2366 100644
--- a/src/hir_typeck/expr_cs.cpp
+++ b/src/hir_typeck/expr_cs.cpp
@@ -433,7 +433,8 @@ namespace {
const auto is_diverge = [&](const ::HIR::TypeRef& rty)->bool {
const auto& ty = this->context.get_type(rty);
- //DEBUG("[visit(_Block) is_diverge] " << rty << " = " << ty);
+ // TODO: Search the entire type for `!`? (What about pointers to it? or Option/Result?)
+ // - A correct search will search for unconditional (ignoring enums with a non-! variant) non-rawptr instances of ! in the type
return ty.m_data.is_Diverge() || (ty.m_data.is_Infer() && ty.m_data.as_Infer().ty_class == ::HIR::InferClass::Diverge);
};
@@ -447,13 +448,9 @@ namespace {
{
auto& snp = node.m_nodes[i];
this->context.add_ivars( snp->m_res_type );
- // TODO: Ignore? or force to ()? - Depends on inner
- // - Blocks (and block-likes) are forced to ()
- // - What if they were '({});'? Then they're left dangling
snp->visit(*this);
// If this statement yields !, then mark the block as diverging
- // - TODO: Search the entire type for `!`? (What about pointers to it? or Option/Result?)
if( is_diverge(snp->m_res_type) ) {
diverges = true;
}