From 9f82bacdadaf7e9d2cfe2c5d98daad2d5cd95f62 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 27 Feb 2016 10:18:08 +0800 Subject: Parse/where - Handle lifetime params --- src/parse/root.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/parse/root.cpp b/src/parse/root.cpp index 9eedd319..4c7d9551 100644 --- a/src/parse/root.cpp +++ b/src/parse/root.cpp @@ -148,7 +148,11 @@ void Parse_WhereClause(TokenStream& lex, AST::GenericParams& params) if( tok.type() == TOK_LIFETIME ) { - throw ParseError::Todo(lex, "Lifetime bounds in 'where' clauses"); + auto lhs = mv$(tok.str()); + GET_CHECK_TOK(tok, lex, TOK_COLON); + GET_CHECK_TOK(tok, lex, TOK_LIFETIME); + auto rhs = mv$(tok.str()); + params.add_bound( AST::GenericBound::make_Lifetime({lhs, rhs}) ); } // Higher-ranked types/lifetimes else if( tok.type() == TOK_RWORD_FOR ) -- cgit v1.2.3