summary refs log tree commit diff
path: root/tests/ui/parser
AgeCommit message (Collapse)AuthorLines
2023-05-27Rollup merge of #111181 - bvanjoi:fix-issue-111148, r=davidtwcoMatthias Krüger-0/+10
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-16Rollup merge of #111449 - compiler-errors:recover-impl-generics-correctly, ↵Nilstrieb-0/+14
r=Nilstrieb Recover `impl<T ?Sized>` correctly Fixes #111327 r? ````@Nilstrieb```` but you can re-roll Alternatively, happy to close this if we're okay with just saying "sorry #111327 is just a poor side-effect of parser ambiguity" 🤷
2023-05-16Rollup merge of #111428 - bvanjoi:fix-109250, r=NilstriebNilstrieb-6/+6
refactor(resolve): clean up the early error return caused by non-call closes https://github.com/rust-lang/rust/issues/109250 It seems no bad happened, r? ``@Nilstrieb``
2023-05-15Recover `impl<T ?Sized>` correctlyMichael Goulet-0/+14
2023-05-13fmtyukang-2/+1
2023-05-13Fix ice caused by shorthand fields in NoFieldsForFnCallyukang-0/+22
2023-05-13fix(parse): return unpected when current token is EOFbohan-0/+10
2023-05-10refactor(resolve): clean up the early error return caused by non-callbohan-6/+6
2023-05-09Rollup merge of #110694 - est31:builtin, r=petrochenkovDylan DPC-0/+23
Implement builtin # syntax and use it for offset_of!(...) Add `builtin #` syntax to the parser, as well as a generic infrastructure to support both item and expression position builtin syntaxes. The PR also uses this infrastructure for the implementation of the `offset_of!` macro, added by #106934. cc `@petrochenkov` `@DrMeepster` cc #110680 `builtin #` tracking issue cc #106655 `offset_of!` tracking issue
2023-05-08suggest struct when we get colon in fileds in enumyukang-20/+0
2023-05-05Add feature gateest31-2/+4
2023-05-05Add parsing for builtin # in expression and item contextest31-0/+21
2023-05-05add hint for =< as <=Zachary Mayhew-0/+67
2023-05-02Implement negative boundsMichael Goulet-48/+61
2023-05-02Auto merge of #109128 - chenyukang:yukang/remove-type-ascription, r=estebankbors-353/+226
Remove type ascription from parser and diagnostics Mostly based on https://github.com/rust-lang/rust/pull/106826 Part of #101728 r? `@estebank`
2023-05-02Rollup merge of #108161 - WaffleLapkin:const_param_ty, r=BoxyUwUDylan DPC-1/+1
Add `ConstParamTy` trait This is a bit sketch, but idk. r? `@BoxyUwU` Yet to be done: - [x] ~~Figure out if it's okay to implement `StructuralEq` for primitives / possibly remove their special casing~~ (it should be okay, but maybe not in this PR...) - [ ] Maybe refactor the code a little bit - [x] Use a macro to make impls a bit nicer Future work: - [ ] Actually™ use the trait when checking if a `const` generic type is allowed - [ ] _Really_ refactor the surrounding code - [ ] Refactor `marker.rs` into multiple modules for each "theme" of markers
2023-05-01sync with masteryukang-6/+0
2023-05-01fix testsyukang-12/+12
2023-05-01fix test casesyukang-226/+50
2023-05-01Rip it outNilstrieb-315/+370
My type ascription Oh rip it out Ah If you think we live too much then You can sacrifice diagnostics Don't mix your garbage Into my syntax So many weird hacks keep diagnostics alive Yet I don't even step outside So many bad diagnostics keep tyasc alive Yet tyasc doesn't even bother to survive!
2023-04-28fixup tests wrt new normalizationMaybe Waffle-1/+1
2023-04-27Migrate trivially translatable `rustc_parse` diagnosticsclubby789-44/+54
2023-04-13Auto merge of #109786 - estebank:tweak-add-line-sugg, r=compiler-errorsbors-1/+1
Tweak output for 'add line' suggestion Closes #108174
2023-04-12Special-case item attributes in the suggestion outputEsteban Küber-1/+0
2023-04-12Tweak output for 'add line' suggestionEsteban Küber-1/+2
2023-04-12Rollup merge of #110135 - compiler-errors:revert-108031, r=davidtwcoMatthias Krüger-4/+4
Revert "Don't recover lifetimes/labels containing emojis as character literals" Reverts PR #108031 per https://github.com/rust-lang/rust/pull/109754#issuecomment-1490452045 Fixes (doesnt close until beta backported) #109746 This reverts commit e3f9db5fc319c6d8eee5d47d216ea6a426070c41. This reverts commit 98b82aedba3f3f581e89df54352914b27f42c6f7. This reverts commit 380fa264132ad481e73cbbf0f3a0feefd99a1d78.
2023-04-11Rollup merge of #109923 - ElectrifyPro:visibility, r=wesleywiserYuki Okushi-17/+29
Update `error [E0449]: unnecessary visibility qualifier` to be more clear This updates the error message `error[E0449]: unnecessary visibility qualifier` by clearly indicating that visibility qualifiers already inherit their visibility from a parent item. The error message previously implied that the qualifiers were permitted, which is not the case anymore. Resolves #109822.
2023-04-10Revert "Don't recover lifetimes/labels containing emojis as character literals"Michael Goulet-4/+4
Reverts PR #108031 Fixes (doesnt close until beta backported) #109746 This reverts commit e3f9db5fc319c6d8eee5d47d216ea6a426070c41. This reverts commit 98b82aedba3f3f581e89df54352914b27f42c6f7. This reverts commit 380fa264132ad481e73cbbf0f3a0feefd99a1d78.
2023-04-07Use smart-resolve when checking for trait in RHS of UFCSMichael Goulet-9/+9
2023-04-07fix: fix regression in #109203Ezra Shaw-0/+22
2023-04-03Update ui tests involving invalid visibility qualifiersTam Pham-17/+29
2023-04-03remove invalid ignore-prettyPietro Albini-1/+0
2023-03-20feat: implement error recovery in `expected_ident_found`Ezra Shaw-33/+96
2023-03-19refactor: improve "ident starts with number" errorEzra Shaw-4/+20
2023-03-14Auto merge of #104833 - Swatinem:async-identity-future, r=compiler-errorsbors-130/+19
Remove `identity_future` indirection This was previously needed because the indirection used to hide some unexplained lifetime errors, which it turned out were related to the `min_choice` algorithm. Removing the indirection also solves a couple of cycle errors, large moves and makes async blocks support the `#[track_caller]`annotation. Fixes https://github.com/rust-lang/rust/issues/104826.
2023-03-12Add recovery for use of removed `box` syntaxclubby789-9/+76
2023-03-12Remove `box_syntax` from AST and use in toolsclubby789-0/+18
2023-03-12Remove uses of `box_syntax` in rustc and toolsclubby789-68/+63
2023-03-09feat/refactor: improve errors in case of ident with number at startEzra Shaw-9/+27
2023-03-08Remove `identity_future` indirectionArpad Borsos-130/+19
This was previously needed because the indirection used to hide some unexplained lifetime errors, which it turned out were related to the `min_choice` algorithm. Removing the indirection also solves a couple of cycle errors, large moves and makes async blocks support the `#[track_caller]` annotation.
2023-03-05add test for https://github.com/rust-lang/rust/issues/108242Lukas Markeffsky-0/+18
2023-03-03check if snippet is `)`Takayuki Maeda-0/+13
2023-03-01Add testcase for issue 105209yukang-0/+25
2023-03-01Fix #104367, add test case for mismatched open/close delimsyukang-0/+32
2023-03-01Auto merge of #108587 - matthiaskrgr:rollup-rw6po59, r=matthiaskrgrbors-0/+108
Rollup of 10 pull requests Successful merges: - #108376 (compiler/rustc_session: fix sysroot detection logic) - #108400 (add llvm cgu instructions stats to perf) - #108496 (fix #108495, postfix decrement and prefix decrement has no warning) - #108505 (Further unify validity intrinsics) - #108520 (Small cleanup to `one_bound_for_assoc_type`) - #108560 (Some `infer/mod.rs` cleanups) - #108563 (Make mailmap more correct) - #108564 (Fix `x clean` with specific paths) - #108571 (Add contains_key to SortedIndexMultiMap) - #108578 (Update Fuchsia platform team members) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-01Rollup merge of #108496 - nx2k3:issue-108495-dec, r=WaffleLapkinMatthias Krüger-0/+108
fix #108495, postfix decrement and prefix decrement has no warning Fixes #108495
2023-03-01Rollup merge of #108297 - chenyukang:yukang/delim-error-exit, r=petrochenkovMatthias Krüger-974/+200
Exit when there are unmatched delims to avoid noisy diagnostics From https://github.com/rust-lang/rust/pull/104012#issuecomment-1311764832 r? ``@petrochenkov``
2023-02-28micro fmt changesMaybe Waffle-12/+10
2023-02-28remove duplicated diagnostic for unclosed delimiteryukang-214/+62
2023-02-28Exit when there are unmatched delims to avoid noisy diagnosticsyukang-807/+185