summaryrefslogtreecommitdiff
path: root/src/hir/from_ast.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-10-24 08:39:49 +0800
committerJohn Hodge <tpg@mutabah.net>2016-10-24 08:39:49 +0800
commit4d6039f0755b88c135492d80e18ab640d402de88 (patch)
tree3382668660eb4061544ae6861e304fed02113e05 /src/hir/from_ast.cpp
parent9aa1f89f273b6acdd171543498bec661a04118fa (diff)
downloadmrust-4d6039f0755b88c135492d80e18ab640d402de88.tar.gz
AST - Remove separate impls list (now in item list)
Diffstat (limited to 'src/hir/from_ast.cpp')
-rw-r--r--src/hir/from_ast.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/hir/from_ast.cpp b/src/hir/from_ast.cpp
index 23cca0e2..1abd7771 100644
--- a/src/hir/from_ast.cpp
+++ b/src/hir/from_ast.cpp
@@ -1072,10 +1072,10 @@ void _add_mod_val_item(::HIR::Module& mod, ::std::string name, bool is_pub, ::H
// TODO: Insert a record of the `link` attribute
),
(Impl,
- TODO(sp, "Expand Item::Impl");
+ //TODO(sp, "Expand Item::Impl");
),
(NegImpl,
- TODO(sp, "Expand Item::NegImpl");
+ //TODO(sp, "Expand Item::NegImpl");
),
(Use,
// Ignore - The index is used to add `Import`s
@@ -1165,8 +1165,10 @@ void LowerHIR_Module_Impls(const ::AST::Module& ast_mod, ::HIR::Crate& hir_crat
}
//
- for( const auto& impl : ast_mod.impls() )
+ for( const auto& i : ast_mod.items() )
{
+ if( !i.data.is_Impl() ) continue;
+ const auto& impl = i.data.as_Impl();
auto params = LowerHIR_GenericParams(impl.def().params(), nullptr);
if( impl.def().trait().ent.is_valid() )
@@ -1301,8 +1303,11 @@ void LowerHIR_Module_Impls(const ::AST::Module& ast_mod, ::HIR::Crate& hir_crat
} );
}
}
- for( const auto& impl : ast_mod.neg_impls() )
+ for( const auto& i : ast_mod.items() )
{
+ if( !i.data.is_NegImpl() ) continue;
+ const auto& impl = i.data.as_NegImpl();
+
auto params = LowerHIR_GenericParams(impl.params(), nullptr);
auto type = LowerHIR_Type(impl.type());
auto trait = LowerHIR_GenericPath(impl.trait().sp, impl.trait().ent);