File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
branches/auto/src/libsyntax/parse Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -14,5 +14,5 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
14
14
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
15
15
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
16
16
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17
- refs/heads/auto: f7a2371c176663d59062ec5158f39faecba45768
17
+ refs/heads/auto: a985bc52cd3e65ee6693327eb728d34f477c0a12
18
18
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
Original file line number Diff line number Diff line change @@ -3107,11 +3107,15 @@ pub impl Parser {
3107
3107
// XXX: clownshoes
3108
3108
let ident = special_idents:: clownshoes_extensions;
3109
3109
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
+
3110
3114
// Parse the trait.
3111
3115
let mut ty = self . parse_ty ( false ) ;
3112
3116
3113
3117
// 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 ") {
3115
3119
// New-style trait. Reinterpret the type as a trait.
3116
3120
let opt_trait_ref = match ty.node {
3117
3121
ty_path(path, node_id) => {
You can’t perform that action at this time.
0 commit comments