about summary refs log tree commit diff
path: root/tests/ui/enum
AgeCommit message (Collapse)AuthorLines
2025-08-27Add test batch 1Oneirical-0/+43
2025-08-17Rehome tests/ui/issues/ tests [5/?]Oneirical-0/+81
2025-08-10Rehome tests/ui/issues/ tests [4/?]Oneirical-0/+34
2025-07-24Rehome tests/ui/issues/ tests [1/?]Oneirical-0/+28
2025-06-12detect when variants have the same name as an associated functionJana Dönszelmann-0/+10
2025-06-12add test for dead code caused by enum variants shadowing an associated functionJana Dönszelmann-0/+40
2025-06-04cleaned up some testsKivooeo-0/+27
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-2/+3
``` error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:7:15 | LL | let _ = 2.l; | ^ | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | LL - let _ = 2.l; LL + let _ = 2.0f64; | ```
2025-02-04Rename and Move some UI tests to more suitable subdirsDuskyElf-0/+27
2024-11-26tests: remove `//@ pretty-expanded` usages许杰友 Jieyou Xu (Joe)-3/+0
Done with ```bash sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs ``` and ``` sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs ```
2024-11-03Properly suggest `E::assoc` when we encounter `E::Variant::assoc`Esteban Küber-1/+1
Use the right span when encountering an enum variant followed by an associated item so we don't lose the associated item in the resulting code. Do not suggest the thing twice, once as a removal of the associated item and a second time as a typo suggestion.
2024-11-03Add test for assoc fn suggestion on enum variantEsteban Küber-0/+29
2024-07-18More accurate suggestions when writing wrong style of enum variant literalEsteban Küber-0/+5
``` error[E0533]: expected value, found struct variant `E::Empty3` --> $DIR/empty-struct-braces-expr.rs:18:14 | LL | let e3 = E::Empty3; | ^^^^^^^^^ not a value | help: you might have meant to create a new value of the struct | LL | let e3 = E::Empty3 {}; | ++ ``` ``` error[E0533]: expected value, found struct variant `E::V` --> $DIR/struct-literal-variant-in-if.rs:10:13 | LL | if x == E::V { field } {} | ^^^^ not a value | help: you might have meant to create a new value of the struct | LL | if x == (E::V { field }) {} | + + ``` ``` error[E0618]: expected function, found enum variant `Enum::Unit` --> $DIR/suggestion-highlights.rs:15:5 | LL | Unit, | ---- enum variant `Enum::Unit` defined here ... LL | Enum::Unit(); | ^^^^^^^^^^-- | | | call expression requires function | help: `Enum::Unit` is a unit enum variant, and does not take parentheses to be constructed | LL - Enum::Unit(); LL + Enum::Unit; | ``` ``` error[E0599]: no variant or associated item named `tuple` found for enum `Enum` in the current scope --> $DIR/suggestion-highlights.rs:36:11 | LL | enum Enum { | --------- variant or associated item `tuple` not found for this enum ... LL | Enum::tuple; | ^^^^^ variant or associated item not found in `Enum` | help: there is a variant with a similar name | LL | Enum::Tuple(/* i32 */); | ~~~~~~~~~~~~~~~~; | ```
2024-07-12Tweak tests to avoid confusing suggestion outputEsteban Küber-8/+8
2024-07-12Make parse error suggestions verbose and fix spansEsteban Küber-9/+21
Go over all structured parser suggestions and make them verbose style. When suggesting to add or remove delimiters, turn them into multiple suggestion parts.
2024-04-21Move some testsCaio-0/+82
2024-04-15Add testMichael Goulet-0/+17
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-5/+5
2024-02-08Continue to borrowck even if there were previous errorsOli Scherer-1/+13
2024-02-01Improve the diagnostics for unused generic parametersLeón Orell Valerian Liehr-6/+6
2023-11-24Show number in error message even for one errorNilstrieb-5/+5
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-06-19Remove unreachable and untested suggestion for invalid span enum derive(Default)Tom Martin-1/+1
2023-05-09Rollup merge of #111215 - BoxyUwU:resolve_anon_consts_differently, r=cjgillotMatthias Krüger-6/+4
Various changes to name resolution of anon consts Sorry this PR is kind of all over the place ^^' Fixes #111012 - Rewrites anon const nameres to all go through `fn resolve_anon_const` explicitly instead of `visit_anon_const` to ensure that we do not accidentally resolve anon consts as if they are allowed to use generics when they aren't. Also means that we dont have bits of code for resolving anon consts that will get out of sync (i.e. legacy const generics and resolving path consts that were parsed as type arguments) - Renames two of the `LifetimeRibKind`, `AnonConst -> ConcreteAnonConst` and `ConstGeneric -> ConstParamTy` - Noticed while doing this that under `generic_const_exprs` all lifetimes currently get resolved to errors without any error being emitted which was causing a bunch of tests to pass without their bugs having been fixed, incidentally fixed that in this PR and marked those tests as `// known-bug:`. I'm fine to break those since `generic_const_exprs` is a very unstable incomplete feature and this PR _does_ make generic_const_exprs "less broken" as a whole, also I can't be assed to figure out what the underlying causes of all of them are. This PR reopens #77357 #83993 - Changed `generics_of` to stop providing generics and predicates to enum variant discriminant anon consts since those are not allowed to use generic parameters - Updated the error for non 'static lifetime in const arguments and the error for non 'static lifetime in const param tys to use `derive(Diagnostic)` I have a vague idea why const-arg-in-const-arg.rs, in-closure.rs and simple.rs have started failing which is unfortunate since these were deliberately made to work, I think lifetime resolution being broken just means this regressed at some point and nobody noticed because the tests were not testing anything :( I'm fine breaking these too for the same reason as the tests for #77357 #83993. I couldn't get `// known-bug` to work for these ICEs and just kept getting different stderr between CI and local `--bless` so I just removed them and will create an issue to track re-adding (and fixing) the bugs if this PR lands. r? `@cjgillot` cc `@compiler-errors`
2023-05-08Move testsCaio-0/+13
2023-05-05improve diagnostics and bless testsBoxy-6/+4
2023-01-11Move /src/test to /testsAlbert Larsan-0/+545