summaryrefslogtreecommitdiff
path: root/src/parse/types.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-06-11 21:24:48 +0800
committerJohn Hodge <tpg@mutabah.net>2016-06-11 21:24:48 +0800
commit59ed1dee6a4777e380982b3b8dd464429d0f423b (patch)
tree557224e84b592441fa2fb698891f5e1a4eb4c7a3 /src/parse/types.cpp
parent75e5245e0adace314adcb457a9943fc749c22a5e (diff)
downloadmrust-59ed1dee6a4777e380982b3b8dd464429d0f423b.tar.gz
Parse - Fix parsing of parens in types
Diffstat (limited to 'src/parse/types.cpp')
-rw-r--r--src/parse/types.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/parse/types.cpp b/src/parse/types.cpp
index c6e33a3d..2dda3cab 100644
--- a/src/parse/types.cpp
+++ b/src/parse/types.cpp
@@ -165,21 +165,16 @@ TypeRef Parse_Type_Int(TokenStream& lex, bool allow_trait_list)
PUTBACK(tok, lex);
TypeRef inner = Parse_Type(lex, true);
- if( GET_TOK(tok, lex) == TOK_PLUS )
+ if( LOOK_AHEAD(lex) == TOK_PAREN_CLOSE )
{
- // Lifetime bounded type, NOT a tuple
- GET_CHECK_TOK(tok, lex, TOK_LIFETIME);
- ::std::string lifetime = tok.str();
+ // Type in parens, NOT a tuple
GET_CHECK_TOK(tok, lex, TOK_PAREN_CLOSE);
- // TODO: Actually use lifetime bound
- DEBUG("TODO: Use lifetime bound '" << lifetime << " on type " << inner);
- return ::std::move(inner);
+ return inner;
}
else
{
::std::vector<TypeRef> types;
- types.push_back( ::std::move(inner) );
- PUTBACK(tok, lex);
+ types.push_back( mv$(inner) );
while( GET_TOK(tok, lex) == TOK_COMMA )
{
if( GET_TOK(tok, lex) == TOK_PAREN_CLOSE )
@@ -189,7 +184,7 @@ TypeRef Parse_Type_Int(TokenStream& lex, bool allow_trait_list)
types.push_back(Parse_Type(lex));
}
CHECK_TOK(tok, TOK_PAREN_CLOSE);
- return TypeRef(TypeRef::TagTuple(), lex.end_span(ps), types); }
+ return TypeRef(TypeRef::TagTuple(), lex.end_span(ps), mv$(types)); }
}
default:
throw ParseError::Unexpected(lex, tok);