From e93b2abf37e594110ef15049d957a8dcac9bc977 Mon Sep 17 00:00:00 2001 From: Brian Leibig Date: Sat, 28 Feb 2015 18:10:41 -0800 Subject: [PATCH] Bison grammar: support parsing default trait impls --- src/grammar/parser-lalr.y | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/grammar/parser-lalr.y b/src/grammar/parser-lalr.y index 6a6f7e0e9f9..9cff58cf89a 100644 --- a/src/grammar/parser-lalr.y +++ b/src/grammar/parser-lalr.y @@ -582,6 +582,14 @@ item_impl { $$ = mk_node("ItemImplNeg", 7, $1, $3, $5, $7, $8, $10, $11); } +| maybe_unsafe IMPL generic_params trait_ref FOR DOTDOT '{' '}' +{ + $$ = mk_node("ItemImplDefault", 3, $1, $3, $4); +} +| maybe_unsafe IMPL generic_params '!' trait_ref FOR DOTDOT '{' '}' +{ + $$ = mk_node("ItemImplDefaultNeg", 3, $1, $3, $4); +} ; maybe_impl_items