diff options
author | John Hodge <tpg@mutabah.net> | 2015-03-22 14:46:48 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2015-03-22 14:46:48 +0800 |
commit | fc9a04403eb5b694d37f77baa0de2f8e363f46f1 (patch) | |
tree | 0f85ba516b784d6151fd45555b86d50c533e909f /src/types.hpp | |
parent | 5aac662e859d10f42b541405fa0b8d14a1c1e2a8 (diff) | |
download | mrust-fc9a04403eb5b694d37f77baa0de2f8e363f46f1.tar.gz |
Parsing "Composite" DSTs (Trait + Trait2 + Trait3)
Diffstat (limited to 'src/types.hpp')
-rw-r--r-- | src/types.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/types.hpp b/src/types.hpp index 9505f2cd..86733ad1 100644 --- a/src/types.hpp +++ b/src/types.hpp @@ -55,6 +55,7 @@ class TypeRef: ARRAY,
GENERIC,
PATH,
+ MULTIDST, // Multi-trait DST (e.g. Trait + Send + Sync)
ASSOCIATED,
};
@@ -147,6 +148,13 @@ public: TypeRef(TagPath(), ::std::move(path))
{}
+ TypeRef( ::std::vector<AST::Path> traits ):
+ m_class(MULTIDST)
+ {
+ for( auto& t : traits )
+ m_inner_types.push_back( TypeRef(::std::move(t)) );
+ }
+
struct TagAssoc {};
TypeRef(TagAssoc, TypeRef base, TypeRef trait, ::std::string assoc_name):
TypeRef(::std::move(base), ::std::move(trait), ::std::move(assoc_name))
|