Skip to content

Commit fb4bcdf

Browse files
committed
---
yaml --- r: 50362 b: refs/heads/auto c: a985bc5 h: refs/heads/master v: v3
1 parent 2a4c321 commit fb4bcdf

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: f7a2371c176663d59062ec5158f39faecba45768
17+
refs/heads/auto: a985bc52cd3e65ee6693327eb728d34f477c0a12
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167

branches/auto/src/libsyntax/parse/parser.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3107,11 +3107,15 @@ pub impl Parser {
31073107
// XXX: clownshoes
31083108
let ident = special_idents::clownshoes_extensions;
31093109

3110+
// Special case: if the next identifier that follows is '(', don't
3111+
// allow this to be parsed as a trait.
3112+
let could_be_trait = *self.token != token::LPAREN;
3113+
31103114
// Parse the trait.
31113115
let mut ty = self.parse_ty(false);
31123116

31133117
// Parse traits, if necessary.
3114-
let opt_trait = if self.eat_keyword(&~"for") {
3118+
let opt_trait = if could_be_trait && self.eat_keyword(&~"for") {
31153119
// New-style trait. Reinterpret the type as a trait.
31163120
let opt_trait_ref = match ty.node {
31173121
ty_path(path, node_id) => {

0 commit comments

Comments
 (0)