diff options
Diffstat (limited to 'src/hir')
-rw-r--r-- | src/hir/from_ast_expr.cpp | 3 | ||||
-rw-r--r-- | src/hir/hir.cpp | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/hir/from_ast_expr.cpp b/src/hir/from_ast_expr.cpp index 39b33e53..08e49aa4 100644 --- a/src/hir/from_ast_expr.cpp +++ b/src/hir/from_ast_expr.cpp @@ -46,6 +46,9 @@ struct LowerHIR_ExprNode_Visitor: virtual void visit(::AST::ExprNode_Macro& v) override { BUG(v.get_pos(), "Hit ExprNode_Macro"); } + virtual void visit(::AST::ExprNode_Asm& v) override { + TODO(v.get_pos(), "Convert asm! to HIR"); + } virtual void visit(::AST::ExprNode_Flow& v) override { switch( v.m_type ) { diff --git a/src/hir/hir.cpp b/src/hir/hir.cpp index 2ec4d40b..18b09fac 100644 --- a/src/hir/hir.cpp +++ b/src/hir/hir.cpp @@ -512,8 +512,6 @@ bool ::HIR::TraitImpl::more_specific_than(const ::HIR::TraitImpl& other) const return false; } - //assert(m_params.m_types.size() == other.m_params.m_types.size()); - if( other.m_params.m_bounds.size() == 0 ) { return m_params.m_bounds.size() > 0; } @@ -527,13 +525,14 @@ bool ::HIR::TraitImpl::more_specific_than(const ::HIR::TraitImpl& other) const DEBUG("bounds_t = " << bounds_t); DEBUG("bounds_o = " << bounds_o); + // If there are less bounds in this impl, it can't be more specific. if( bounds_t.size() < bounds_o.size() ) return false; auto it_t = bounds_t.begin(); for(auto it_o = bounds_o.begin(); it_o != bounds_o.end(); ++it_o) { - // TODO: `T: Foo<T>` is more specific than `T: Foo<U>` + // TODO: `T: Foo<T>` is more specific than `T: Foo<U>`, this method doesn't pick that. while( ::ord(*it_t, *it_o) == OrdLess && it_t != bounds_t.end() ) ++ it_t; if( it_t == bounds_t.end() || ::ord(*it_t, *it_o) > OrdEqual ) { |