1
Fork 0
rust/compiler/rustc_parse/src/parser
bors 62c068feea Auto merge of #127636 - nnethercote:fix-Parser-look_ahead, r=oli-obk
Fix `Parser::look_ahead`

`Parser::look_ahead` has a slow but simple general case, and a fast special case that is hit most of the time. But the special case is buggy and behaves differently to the general case. There are also no unit tests. This PR fixes all of this, resulting in a `Parser::look_ahead` that is equally fast, slightly simpler, more correct, and better tested.

r? `@davidtwco`
2024-07-12 17:28:21 +00:00
..
mut_visit Specialize assert_pred. 2024-06-06 08:26:54 +10:00
tokenstream Move some tests from rustc_expand to rustc_parse. 2024-05-06 09:06:02 +10:00
attr.rs Simplify ReplaceRange. 2024-07-07 15:58:36 +10:00
attr_wrapper.rs Remove Clone derive from LazyAttrTokenStreamImpl. 2024-07-07 16:24:51 +10:00
diagnostics.rs Rollup merge of #126125 - dev-ardi:conflict-markers, r=estebank 2024-06-21 09:12:34 +02:00
expr.rs Rollup merge of #127103 - compiler-errors:tighten-trait-bound-parsing, r=fmease 2024-06-29 09:14:59 +02:00
generics.rs Move binder and polarity parsing into parse_generic_ty_bound 2024-06-28 19:40:31 -04:00
item.rs Auto merge of #127382 - estebank:const-let, r=compiler-errors 2024-07-12 01:18:12 +00:00
mod.rs Add a new special case to Parser::look_ahead. 2024-07-12 13:35:24 +10:00
nonterminal.rs Rework pattern and expression nonterminal kinds. 2024-06-23 15:57:24 +10:00
pat.rs Inline can_begin_literal_maybe_minus call into two places. 2024-06-20 04:50:38 +10:00
path.rs Change RTN to use .. again 2024-06-28 14:20:43 -04:00
stmt.rs Refactor parse_expr_res. 2024-06-19 19:12:02 +10:00
tests.rs Remove the bogus special case from Parser::look_ahead. 2024-07-12 13:33:38 +10:00
ty.rs Move binder and polarity parsing into parse_generic_ty_bound 2024-06-28 19:40:31 -04:00