mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
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.
This commit is contained in:
commit
80a2306aee
@ -177,11 +177,10 @@ pub fn check_expr(v: &mut CheckCrateVisitor,
|
||||
}
|
||||
}
|
||||
}
|
||||
ExprParen(e) => { check_expr(v, sess, def_map, method_map,
|
||||
tcx, e, is_const); }
|
||||
ExprVstore(_, ExprVstoreSlice) |
|
||||
ExprVec(_, MutImmutable) |
|
||||
ExprAddrOf(MutImmutable, _) |
|
||||
ExprParen(..) |
|
||||
ExprField(..) |
|
||||
ExprIndex(..) |
|
||||
ExprTup(..) |
|
||||
|
25
src/test/run-pass/super-fast-paren-parsing.rs
Normal file
25
src/test/run-pass/super-fast-paren-parsing.rs
Normal file
@ -0,0 +1,25 @@
|
||||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
static a: int =
|
||||
(((((((((((((((((((((((((((((((((((((((((((((((((((
|
||||
(((((((((((((((((((((((((((((((((((((((((((((((((((
|
||||
(((((((((((((((((((((((((((((((((((((((((((((((((((
|
||||
(((((((((((((((((((((((((((((((((((((((((((((((((((
|
||||
(((((((((((((((((((((((((((((((((((((((((((((((((((
|
||||
1
|
||||
)))))))))))))))))))))))))))))))))))))))))))))))))))
|
||||
)))))))))))))))))))))))))))))))))))))))))))))))))))
|
||||
)))))))))))))))))))))))))))))))))))))))))))))))))))
|
||||
)))))))))))))))))))))))))))))))))))))))))))))))))))
|
||||
)))))))))))))))))))))))))))))))))))))))))))))))))))
|
||||
;
|
||||
|
||||
pub fn main() {}
|
Loading…
Reference in New Issue
Block a user