syntax: Fix parsing of inherent traits
This commit is contained in:
parent
2772b2e5c7
commit
92ef17aaeb
@ -2436,7 +2436,8 @@ class parser {
|
||||
!self.token_is_keyword(~"of", self.look_ahead(1)) &&
|
||||
!self.token_is_keyword(~"for", self.look_ahead(1)) &&
|
||||
self.look_ahead(1) != token::BINOP(token::SLASH) &&
|
||||
self.look_ahead(1) != token::LT {
|
||||
(self.look_ahead(1) != token::LT
|
||||
|| (self.look_ahead(1) == token::LT && tps.is_not_empty())) {
|
||||
|
||||
// This is a new-style impl declaration.
|
||||
ident = @~"__extensions__"; // XXX: clownshoes
|
||||
|
20
src/test/run-pass/impl-implicit-trait.rs
Normal file
20
src/test/run-pass/impl-implicit-trait.rs
Normal file
@ -0,0 +1,20 @@
|
||||
enum option_<T> {
|
||||
none_,
|
||||
some_(T),
|
||||
}
|
||||
|
||||
impl<T> option_<T> {
|
||||
fn foo() -> bool { true }
|
||||
}
|
||||
|
||||
enum option__ {
|
||||
none__,
|
||||
some__(int)
|
||||
}
|
||||
|
||||
impl option__ {
|
||||
fn foo() -> bool { true }
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user