about summary refs log tree commit diff
path: root/tests/ui/parser
AgeCommit message (Collapse)AuthorLines
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
2023-02-27handle only postfix decrementnx2k3-48/+0
2023-02-27check double negationnx2k3-81/+80
2023-02-26fix #108495, postfix decrement and prefix decrement has no warningnx2k3-0/+159
2023-02-26generalize help messagey21-3/+7
2023-02-18Rollup merge of #108031 - jieyouxu:issue-108019, r=estebankMatthias Krüger-4/+4
Don't recover lifetimes/labels containing emojis as character literals Fixes #108019. Note that at the time of this commit, `unic-emoji-char` seems to have data tables only up to Unicode 5.0, but Unicode is already newer than this. A newer emoji such as `🥺` will not be recognized as an emoji but older emojis such as `🐱` will. This PR leaves a couple of FIXMEs where `unic_emoji_char::is_emoji` is used.
2023-02-16Add feature gate for non_lifetime_bindersMichael Goulet-6/+6
2023-02-14Rollup merge of #103478 - SpanishPear:spanishpear/issue_103366_fix, r=TaKO8KiMatthias Krüger-0/+231
Suggest fix for misplaced generic params on fn item #103366 fixes #103366 This still has some work to go, but works for 2/3 of the initial base cases described in #1033366 simple fn: ``` error: expected identifier, found `<` --> shreys/test_1.rs:1:3 | 1 | fn<T> id(x: T) -> T { x } | ^ expected identifier | help: help: place the generic parameter list after the function name: | 1 | fn id<T>(x: T) -> T { x } | ~~~~ ``` Complicated bounds ``` error: expected identifier, found `<` --> spanishpear/test_2.rs:1:3 | 1 | fn<'a, B: 'a + std::ops::Add<Output = u32>> f(_x: B) { } | ^ expected identifier | help: help: place the generic parameter list after the function name: | 1 | fn f<'a, B: 'a + std::ops::Add<Output = u32>>(_x: B) { } | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Opening a draft PR for comments on approach, particularly I have the following questions: - [x] Is it okay to be using `err.span_suggestion` over struct derives? I struggled to get the initial implementation (particularly the correct suggestion message) on struct derives, although I think given what I've learned since starting, I could attempt re-doing it with that approach. - [x] in the case where the snippet cannot be obtained from a span, is the `help` but no suggestion okay? I think yes (also, when does this case occur?) - [x] are there any red flags for the generalisation of this work for relevant item kinds (i.e. `struct`, `enum`, `trait`, and `union`). My basic testing indicates it does work for those types except the help tip is currently hardcoded to `after the function name` - which should change dependent on the item. - [x] I am planning to not show the suggestion if there is already a `<` after the item identifier, (i.e. if there are already generics, as after a function name per the original issue). Any major objections? - [x] Is the style of error okay? I wasn't sure if there was a way to make it display nicer, or if thats handled by span_suggestion These aren't blocking questions, and I will keep working on: - check if there is a `<` after the ident (and if so, not showing the suggestion) - generalize the help message - figuring out how to write/run/etc ui tests (including reading the docs for them) - logic cleanups
2023-02-14Update numeric lifetime test许杰友 Jieyou Xu (Joe)-4/+4