rust/src/libsyntax/ext
bors 4f3c7a472b Auto merge of #52145 - ExpHP:drop-it-like-its-eof, r=nikomatsakis
Fix macro parser quadratic complexity in small repeating groups

Observed in #51754, and more easily demonstrated with the following:

```rust
macro_rules! stress {
    ($($t:tt)+) => { };
}

fn main() {
    stress!{
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        //    ... 65536 copies of "a" total ...
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
    }
}
```
which takes 50 seconds to compile prior to the fix and <1s after.

I hope this has a visible impact on the compile times for real code.  (I think it is most likely to affect incremental TT munchers that deal with large inputs, though it depends on how they are written)

For a fuller description of the performance issue:  https://github.com/rust-lang/rust/issues/51754#issuecomment-403242159

---

There is no test (yet) because I'm not sure how easily to measure this for regressions.
2018-07-17 19:28:23 +00:00
..
tt Auto merge of #52145 - ExpHP:drop-it-like-its-eof, r=nikomatsakis 2018-07-17 19:28:23 +00:00
base.rs Auto merge of #52383 - petrochenkov:pmns, r=alexcrichton 2018-07-15 19:35:06 +00:00
build.rs async await desugaring and tests 2018-06-21 22:36:36 -07:00
derive.rs Implement #[macro_export(local_inner_macros)] 2018-06-27 13:10:16 +03:00
expand.rs rustc: Stabilize much of the proc_macro feature 2018-07-16 07:58:06 -07:00
placeholders.rs expansion: Rename Expansion to AstFragment 2018-06-23 20:09:21 +03:00
quote.rs Deny bare trait objects in in src/libsyntax 2018-07-10 21:06:26 +02:00
source_util.rs Deny bare trait objects in in src/libsyntax 2018-07-10 21:06:26 +02:00