diff options
author | John Hodge <tpg@mutabah.net> | 2015-03-29 22:28:21 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2015-03-29 22:28:21 +0800 |
commit | e60aa50103d9b24819f3dc26c783c2237f873664 (patch) | |
tree | b886638fd90724e968b9201f9ab12369ba5e1113 /src/parse/root.cpp | |
parent | 2a0d3a03e3f32e383ed61beb2514ac3094fffb0f (diff) | |
download | mrust-e60aa50103d9b24819f3dc26c783c2237f873664.tar.gz |
Minor tweaks to handle libcore update
Diffstat (limited to 'src/parse/root.cpp')
-rw-r--r-- | src/parse/root.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/parse/root.cpp b/src/parse/root.cpp index cbc0ef3b..eefe0d52 100644 --- a/src/parse/root.cpp +++ b/src/parse/root.cpp @@ -684,9 +684,18 @@ AST::Impl Parse_Impl(TokenStream& lex, bool is_unsafe/*=false*/) if( GET_TOK(tok, lex) == TOK_RWORD_FOR )
{
- // Implementing a trait for another type, get the target type
trait_type = impl_type;
- impl_type = Parse_Type(lex);
+ // Implementing a trait for another type, get the target type
+ if( GET_TOK(tok, lex) == TOK_DOUBLE_DOT )
+ {
+ // Default impl
+ impl_type = TypeRef();
+ }
+ else
+ {
+ lex.putback(tok);
+ impl_type = Parse_Type(lex);
+ }
}
else {
lex.putback(tok);
@@ -717,6 +726,7 @@ AST::Impl Parse_Impl(TokenStream& lex, bool is_unsafe/*=false*/) void Parse_Impl_Item(TokenStream& lex, AST::Impl& impl)
{
+ TRACE_FUNCTION;
Token tok;
GET_TOK(tok, lex);
|