Skip to content

Commit 80a2306

Browse files
committed
auto merge of #11662 : alexcrichton/rust/faster-parens, r=huonw
The included test case would essentially never finish compiling without this patch. It recursies twice at every ExprParen meaning that the branching factor is 2^n The included test case will take so long to parse on the old compiler that it'll surely never let this crop up again.
2 parents 62f8661 + 1f542cd commit 80a2306

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

src/librustc/middle/check_const.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,10 @@ pub fn check_expr(v: &mut CheckCrateVisitor,
177177
}
178178
}
179179
}
180-
ExprParen(e) => { check_expr(v, sess, def_map, method_map,
181-
tcx, e, is_const); }
182180
ExprVstore(_, ExprVstoreSlice) |
183181
ExprVec(_, MutImmutable) |
184182
ExprAddrOf(MutImmutable, _) |
183+
ExprParen(..) |
185184
ExprField(..) |
186185
ExprIndex(..) |
187186
ExprTup(..) |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
static a: int =
12+
(((((((((((((((((((((((((((((((((((((((((((((((((((
13+
(((((((((((((((((((((((((((((((((((((((((((((((((((
14+
(((((((((((((((((((((((((((((((((((((((((((((((((((
15+
(((((((((((((((((((((((((((((((((((((((((((((((((((
16+
(((((((((((((((((((((((((((((((((((((((((((((((((((
17+
1
18+
)))))))))))))))))))))))))))))))))))))))))))))))))))
19+
)))))))))))))))))))))))))))))))))))))))))))))))))))
20+
)))))))))))))))))))))))))))))))))))))))))))))))))))
21+
)))))))))))))))))))))))))))))))))))))))))))))))))))
22+
)))))))))))))))))))))))))))))))))))))))))))))))))))
23+
;
24+
25+
pub fn main() {}

0 commit comments

Comments
 (0)