rust/tests
Matthias Krüger 97fae38bf9
Rollup merge of #111181 - bvanjoi:fix-issue-111148, r=davidtwco
fix(parse): return unpected when current token is EOF

close https://github.com/rust-lang/rust/issues/111148

#111148 panic occurred because [FatalError.raise()](https://github.com/bvanjoi/rust/blob/master/compiler/rustc_parse/src/parser/mod.rs#LL540C3-L540C3) was encountered which caused by `Eof` and `Pound`(the last token) had same span, when parsing `#` in `fn a<<i<Y<w<>#`.

<img width="825" alt="image" src="https://user-images.githubusercontent.com/30187863/236612589-9e2c6a0b-18cd-408c-b636-c12a51cbcf1c.png">

There are a few ways to solve this problem:

- Change the action assign for [self.last_unexpected_token_span](https://github.com/rust-lang/rust/blob/master/compiler/rustc_parse/src/parser/diagnostics.rs#L592), for example, if current token is `Eof`, then return Error directly.
- Avoid triggering the `FatalError` when the current token is `Eof`.

I have chosen the second option because executing `expected_one_of_not_found` when the token is `Eof` but not in `ediable` seems reasonable.
2023-05-27 20:40:28 +02:00
..
assembly Also assume wrap-around discriminants in as MIR building 2023-05-18 10:28:36 -07:00
auxiliary
codegen Auto merge of #86844 - bjorn3:global_alloc_improvements, r=pnkfelix 2023-05-25 16:59:57 +00:00
codegen-units
debuginfo Add multiple borrow test. 2023-05-13 10:32:32 +00:00
incremental Delay a bug when overwriting fed value. 2023-05-17 20:42:03 +00:00
mir-opt Rollup merge of #111579 - scottmcm:enum-as-signed, r=oli-obk 2023-05-23 16:44:27 +05:30
pretty Rollup merge of #111042 - Zalathar:no-coverage, r=wesleywiser 2023-05-01 17:10:24 +02:00
run-make Auto merge of #86844 - bjorn3:global_alloc_improvements, r=pnkfelix 2023-05-25 16:59:57 +00:00
run-make-fulldeps Move BodyWithBorrowckFacts to consumers 2023-05-23 14:36:36 +02:00
run-pass-valgrind
rustdoc Rollup merge of #111997 - GuillaumeGomez:re-export-doc-hidden-macros, r=notriddle 2023-05-27 13:38:33 +02:00
rustdoc-gui Auto merge of #111348 - ozkanonur:remove-hardcoded-rustdoc-flags, r=albertlarsan68,oli-obk 2023-05-27 04:20:44 +00:00
rustdoc-js Rollup merge of #110780 - notriddle:notriddle/slice-index, r=GuillaumeGomez 2023-05-06 09:09:31 +09:00
rustdoc-js-std
rustdoc-json Serialize all enums as externally tagged to guarantee compatibility with binary formats such as bincode or postcard 2023-05-22 18:22:08 +01:00
rustdoc-ui rustdoc: get unnormalized link destination for suggestions 2023-05-26 18:38:46 -07:00
ui Rollup merge of #111181 - bvanjoi:fix-issue-111148, r=davidtwco 2023-05-27 20:40:28 +02:00
ui-fulldeps Rollup merge of #110747 - oli-obk:smirty, r=spastorino 2023-05-10 06:12:13 +02:00
COMPILER_TESTS.md