diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-08-27 18:44:56 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-08-27 18:44:56 +0800 |
commit | 1ea188d13b8ea8d977c82ff0060b6420d8c81ffc (patch) | |
tree | 8a1fa0dd64a57afd683ab81542defb830c67b126 /src/hir | |
parent | 441d81e301d1c460320c2239f814307e3f7f22e5 (diff) | |
download | mrust-1ea188d13b8ea8d977c82ff0060b6420d8c81ffc.tar.gz |
Lower HIR - Hack around 'Self' replacement
Diffstat (limited to 'src/hir')
-rw-r--r-- | src/hir/from_ast.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/hir/from_ast.cpp b/src/hir/from_ast.cpp index b4ea38e6..3e366d8f 100644 --- a/src/hir/from_ast.cpp +++ b/src/hir/from_ast.cpp @@ -552,6 +552,21 @@ return rv; ) else { + if(const auto* e = path.m_class.opt_UFCS()) { + DEBUG(path); + if( !e->type ) { + } + //else if( e->trait ) { + //} + else if( ! e->nodes.empty() ) { + } + else if( !e->type->m_data.is_Path() ) { + } + else { + // HACK: `Self` replacement + return LowerHIR_GenericPath(sp, e->type->m_data.as_Path().path, false); + } + } BUG(sp, "Encountered non-Absolute path when creating ::HIR::GenericPath - " << path); } } |