File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
branches/try/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 2
2
refs/heads/master: 5f13e9ccc2e3328d4cd8ca49f84e6840dd998346
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: f7a2371c176663d59062ec5158f39faecba45768
5
- refs/heads/try: f7a2371c176663d59062ec5158f39faecba45768
5
+ refs/heads/try: a985bc52cd3e65ee6693327eb728d34f477c0a12
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
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