diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-07-16 13:56:36 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-07-16 13:56:36 +0800 |
commit | c0688f03d081882dde1e5c8d2be6460cb3df4619 (patch) | |
tree | f8b2f85600f37f3790d1864f86e8ad598abd933e /src/hir | |
parent | 97567dbbd8c3f8719dbb9e32c6d0f3a155246508 (diff) | |
download | mrust-c0688f03d081882dde1e5c8d2be6460cb3df4619.tar.gz |
AST - Little tweaks for upgraded test source
Diffstat (limited to 'src/hir')
-rw-r--r-- | src/hir/from_ast.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/hir/from_ast.cpp b/src/hir/from_ast.cpp index 96cd4725..b4ea38e6 100644 --- a/src/hir/from_ast.cpp +++ b/src/hir/from_ast.cpp @@ -69,12 +69,13 @@ rv.m_bounds.back().as_TraitBound().trait.m_hrls = e.hrls; ), (MaybeTrait, - if( ! e.type.m_data.is_Generic() ) - BUG(bound.span, "MaybeTrait on non-param"); - const auto& ge = e.type.m_data.as_Generic(); + auto type = LowerHIR_Type(e.type); + if( ! type.m_data.is_Generic() ) + BUG(bound.span, "MaybeTrait on non-param - " << type); + const auto& ge = type.m_data.as_Generic(); const auto& param_name = ge.name; unsigned param_idx; - if( ge.index == 0xFFFF ) { + if( ge.binding == 0xFFFF ) { if( !self_is_sized ) { BUG(bound.span, "MaybeTrait on parameter on Self when not allowed"); } @@ -83,7 +84,7 @@ else { param_idx = ::std::find_if( rv.m_types.begin(), rv.m_types.end(), [&](const auto& x) { return x.m_name == param_name; } ) - rv.m_types.begin(); if( param_idx >= rv.m_types.size() ) { - BUG(bound.span, "MaybeTrait on parameter not in parameter list (#" << ge.index << " " << param_name << ")"); + BUG(bound.span, "MaybeTrait on parameter not in parameter list (#" << ge.binding << " " << param_name << ")"); } } |