diff options
author | John Hodge <tpg@mutabah.net> | 2016-10-23 19:38:13 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-10-23 19:38:13 +0800 |
commit | ea3c657845313a274f99cc568ff4e3310e248e15 (patch) | |
tree | f8e381baa016bc499cb982bff6e8a2aebe392508 /src/ast/types.cpp | |
parent | 061b63d4fd88e5802927bd42d4b0fd8d5f6fc0f8 (diff) | |
download | mrust-ea3c657845313a274f99cc568ff4e3310e248e15.tar.gz |
AST+HIR - Add stubbed support for erased types (`impl Trait`)
Diffstat (limited to 'src/ast/types.cpp')
-rw-r--r-- | src/ast/types.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ast/types.cpp b/src/ast/types.cpp index 1c6cc568..7468dcf7 100644 --- a/src/ast/types.cpp +++ b/src/ast/types.cpp @@ -118,6 +118,7 @@ TypeRef::TypeRef(const TypeRef& other) _COPY(Generic) _COPY(Path) _COPY(TraitObject) + _COPY(ErasedType) #undef _COPY #undef _CLONE } @@ -172,6 +173,9 @@ Ordering TypeRef::ord(const TypeRef& x) const ), (TraitObject, return ::ord(ent.traits, x_ent.traits); + ), + (ErasedType, + return ::ord(ent.traits, x_ent.traits); ) ) throw ::std::runtime_error(FMT("BUGCHECK - Unhandled TypeRef class '" << m_data.tag() << "'")); @@ -249,6 +253,15 @@ Ordering TypeRef::ord(const TypeRef& x) const } os << ")"; ) + _(ErasedType, + os << "impl "; + for( const auto& it : ent.traits ) { + if( &it != &ent.traits.front() ) + os << "+"; + os << it; + } + os << ""; + ) } #undef _ //os << ")"; |