diff options
Diffstat (limited to 'src/hir/hir.hpp')
-rw-r--r-- | src/hir/hir.hpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/hir/hir.hpp b/src/hir/hir.hpp index 6843e93d..1a933993 100644 --- a/src/hir/hir.hpp +++ b/src/hir/hir.hpp @@ -231,10 +231,15 @@ struct AssociatedType ::std::vector< ::HIR::TraitPath> m_trait_bounds; ::HIR::TypeRef m_default; }; -TAGGED_UNION(TraitValueItem, Constant, +TAGGED_UNION_EX(TraitValueItem, (), Constant, ( (Constant, Constant), (Static, Static), (Function, Function) + ), + (),(), + ( + unsigned int vtable_ofs = ~0u; + ) ); struct Trait { @@ -247,6 +252,9 @@ struct Trait ::std::unordered_map< ::std::string, AssociatedType > m_types; ::std::unordered_map< ::std::string, TraitValueItem > m_values; + // Indexes in the parameter list for each associated type + ::std::unordered_map< ::std::string, unsigned int > m_type_indexes; + Trait( GenericParams gps, ::std::string lifetime, ::std::vector< ::HIR::TraitPath> parents): m_params( mv$(gps) ), m_lifetime( mv$(lifetime) ), |