summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2017-10-01 16:35:11 +0800
committerJohn Hodge <tpg@ucc.asn.au>2017-10-01 16:35:11 +0800
commit35b30d61519926aaf2114ef750cd774a1a3c7985 (patch)
tree846ec9842414d676068026b81024cce4cef08128 /src
parentab7df1d155b46da13d7734737315a187c50e1734 (diff)
downloadmrust-35b30d61519926aaf2114ef750cd774a1a3c7985.tar.gz
Resolve - Handle path binding for unit structs in patterns
Diffstat (limited to 'src')
-rw-r--r--src/resolve/absolute.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/resolve/absolute.cpp b/src/resolve/absolute.cpp
index ef635ef0..f3c68ffb 100644
--- a/src/resolve/absolute.cpp
+++ b/src/resolve/absolute.cpp
@@ -992,6 +992,13 @@ namespace {
if( v != hmod->m_value_items.end() ) {
TU_MATCH_DEF(::HIR::ValueItem, (v->second->ent), (e),
(
+ DEBUG("Ignore - " << v->second->ent.tag_str());
+ ),
+ (StructConstant,
+ auto ty_path = e.ty;
+ path.bind( ::AST::PathBinding::make_Struct({nullptr, &crate.m_hir->get_struct_by_path(sp, ty_path)}) );
+ path = split_into_crate(sp, mv$(path), start, crate.m_name);
+ return ;
),
(Import,
Resolve_Absolute_Path_BindAbsolute__hir_from_import(context, sp, true, path, e.path);
@@ -1005,6 +1012,9 @@ namespace {
)
)
}
+ else {
+ DEBUG("No value item for " << name);
+ }
}
break;
case Context::LookupMode::Constant: