diff options
author | John Hodge <tpg@mutabah.net> | 2018-05-27 11:33:04 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2018-05-27 11:33:04 +0800 |
commit | af1ec8a893d33aa974186d06498d0fc81d22ae7b (patch) | |
tree | 294ad6c81512df1901af85df5e563db2a98c33c7 /src/parse/root.cpp | |
parent | 84392bea7f6f0754f61d5b424129eb5fa809674d (diff) | |
download | mrust-af1ec8a893d33aa974186d06498d0fc81d22ae7b.tar.gz |
AST - Include HRBs on fn() types, fix minor parsing bug
Diffstat (limited to 'src/parse/root.cpp')
-rw-r--r-- | src/parse/root.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/parse/root.cpp b/src/parse/root.cpp index 0fcbe63a..0a8d2909 100644 --- a/src/parse/root.cpp +++ b/src/parse/root.cpp @@ -183,9 +183,11 @@ void Parse_TypeBound(TokenStream& lex, AST::GenericParams& ret, TypeRef checked_ else { PUTBACK(tok, lex); } + auto trait_path = Parse_Path(lex, PATH_GENERIC_TYPE); + auto this_outer_hrbs = (lex.lookahead(0) == TOK_PLUS ? AST::HigherRankedBounds(outer_hrbs) : mv$(outer_hrbs)); ret.add_bound( AST::GenericBound::make_IsTrait({ - mv$(outer_hrbs), checked_type.clone(), mv$(inner_hrls), Parse_Path(lex, PATH_GENERIC_TYPE) + mv$(this_outer_hrbs), checked_type.clone(), mv$(inner_hrls), mv$(trait_path) }) ); } } while( GET_TOK(tok, lex) == TOK_PLUS ); |