diff options
author | John Hodge <tpg@mutabah.net> | 2016-09-01 14:33:37 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-09-01 14:33:37 +0800 |
commit | 7e0eb7625025bc88812ef04432290cd5599c9904 (patch) | |
tree | 2cc8a2db39398481f89f3047f556825684e66ccc /src/hir/from_ast.cpp | |
parent | ab2fe156151026b05caee2f601e34fa37eb35df6 (diff) | |
download | mrust-7e0eb7625025bc88812ef04432290cd5599c9904.tar.gz |
HIR FromAST - Fix is_marker flag on traits
Diffstat (limited to 'src/hir/from_ast.cpp')
-rw-r--r-- | src/hir/from_ast.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/hir/from_ast.cpp b/src/hir/from_ast.cpp index b0768a84..bf0f39b8 100644 --- a/src/hir/from_ast.cpp +++ b/src/hir/from_ast.cpp @@ -685,13 +685,17 @@ ), (TraitObject, if( e.hrls.size() > 0 ) - TODO(ty.span(), "TODO: TraitObjects with HRLS"); + TODO(ty.span(), "TraitObjects with HRLS - " << ty); ::HIR::TypeRef::Data::Data_TraitObject v; for(const auto& t : e.traits) { + DEBUG("t = " << t); const auto& tb = t.binding().as_Trait(); assert( tb.trait_ || tb.hir ); - if( (tb.trait_ && tb.trait_->is_marker()) || (tb.hir->m_is_marker) ) { + if( (tb.trait_ ? tb.trait_->is_marker() : tb.hir->m_is_marker) ) { + if( tb.hir ) { + DEBUG(tb.hir->m_values.size()); + } v.m_markers.push_back( LowerHIR_GenericPath(ty.span(), t) ); } else { @@ -912,6 +916,8 @@ namespace { ) } + rv.m_is_marker = f.is_marker(); + return rv; } ::HIR::Function LowerHIR_Function(::HIR::ItemPath p, const ::AST::Function& f, const ::HIR::TypeRef& self_type) |