diff options
author | John Hodge <tpg@mutabah.net> | 2016-10-22 13:38:27 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-10-22 16:00:27 +0800 |
commit | 2a3fe3be8373594fcd7e46fd4d9c151c28317c9e (patch) | |
tree | 7e0557337ef10bc870d2a243b61dd3d9af65e6cd /src/hir/from_ast.cpp | |
parent | 5a20d91b53d7889a5be8ed9dabeccbac0371f121 (diff) | |
download | mrust-2a3fe3be8373594fcd7e46fd4d9c151c28317c9e.tar.gz |
HIR - Allow (partial) TraitObject with no data trait, better logging of ItemPath
Diffstat (limited to 'src/hir/from_ast.cpp')
-rw-r--r-- | src/hir/from_ast.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/hir/from_ast.cpp b/src/hir/from_ast.cpp index 3c7215f4..cd8be320 100644 --- a/src/hir/from_ast.cpp +++ b/src/hir/from_ast.cpp @@ -13,6 +13,7 @@ #include "from_ast.hpp" #include "visitor.hpp" #include <macro_rules/macro_rules.hpp> +#include <hir/item_path.hpp> ::HIR::Module LowerHIR_Module(const ::AST::Module& module, ::HIR::ItemPath path, ::std::vector< ::HIR::SimplePath> traits = {}); ::HIR::Function LowerHIR_Function(::HIR::ItemPath path, const ::AST::Function& f, const ::HIR::TypeRef& self_type); @@ -724,7 +725,8 @@ v.m_trait = LowerHIR_TraitPath(ty.span(), t); } } - ASSERT_BUG(ty.span(), v.m_trait.m_path.m_path.m_components.size() > 0, "TraitObject type didn't contain a data trait - " << ty); + // TODO: This is possible - &Send is for some reason a valid trait object + //ASSERT_BUG(ty.span(), v.m_trait.m_path.m_path != ::HIR::SimplePath(), "TraitObject type didn't contain a data trait - " << ty); return ::HIR::TypeRef( ::HIR::TypeRef::Data::make_TraitObject( mv$(v) ) ); ), (Function, @@ -1164,7 +1166,7 @@ void LowerHIR_Module_Impls(const ::AST::Module& ast_mod, ::HIR::Crate& hir_crat { auto type = LowerHIR_Type(impl.def().type()); - ::HIR::ItemPath path(type, trait_name); + ::HIR::ItemPath path(type, trait_name, trait_args); DEBUG(path); ::std::map< ::std::string, ::HIR::TraitImpl::ImplEnt< ::HIR::Function> > methods; |