summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-02-27 10:18:08 +0800
committerJohn Hodge <tpg@mutabah.net>2016-02-27 10:18:08 +0800
commit9f82bacdadaf7e9d2cfe2c5d98daad2d5cd95f62 (patch)
treefee6c8c7d514625c274b5ff3b1966a03491f9776 /src
parent7d66b48d85dd9d03378cb66bde3fd85cdf8df49a (diff)
downloadmrust-9f82bacdadaf7e9d2cfe2c5d98daad2d5cd95f62.tar.gz
Parse/where - Handle lifetime params
Diffstat (limited to 'src')
-rw-r--r--src/parse/root.cpp6
1 files changed, 5 insertions, 1 deletions
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 )