about summary refs log tree commit diff
path: root/src/test/ui/destructuring-assignment
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-680/+0
2022-12-13Inform the user which trait is meant in the diagnostic itself instead of ↵Oli Scherer-1/+1
relying on the span making it obvious
2022-12-13Make some diagnostics not depend on the source of what they reference being ↵Oli Scherer-3/+0
available
2022-10-01bless ui testsMaybe Waffle-1/+1
2022-07-01Shorten def_span for more items.Camille GILLOT-8/+2
2022-05-06Resolve vars in note_type_errJack Huey-6/+6
2022-04-06Fix unit struct/enum variant in destructuring assignmentMichael Goulet-0/+34
2022-03-27Point (again) to more expressions with their type, even if not fully resolvedEsteban Kuber-3/+9
2021-12-15Auto merge of #91962 - matthiaskrgr:rollup-2g082jw, r=matthiaskrgrbors-9/+3
Rollup of 7 pull requests Successful merges: - #91880 (fix clippy::single_char_pattern perf findings) - #91885 (Remove `in_band_lifetimes` from `rustc_codegen_ssa`) - #91898 (Make `TyS::is_suggestable` check for non-suggestable types structually) - #91915 (Add another regression test for unnormalized fn args with Self) - #91916 (Fix a bunch of typos) - #91918 (Constify `bool::then{,_some}`) - #91920 (Use `tcx.def_path_hash` in `ExistentialPredicate.stable_cmp`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-12-14Stabilize `destructuring_assignment`Jacob Pratt-171/+34
2021-12-14Make TyS::is_suggestable more structualMichael Goulet-9/+3
2021-10-05Consider unfulfilled obligations in binop errorsEsteban Kuber-1/+16
When encountering a binop where the types would have been accepted, if all the predicates had been fulfilled, include information about the predicates and suggest appropriate `#[derive]`s if possible. Point at trait(s) that needs to be `impl`emented.
2021-08-25Adjust spansNoah Lev-4/+4
* Highlight the whole pattern if it has no fields * Highlight the whole definition if it has no fields * Only highlight the pattern name if the pattern is multi-line * Determine whether a pattern is multi-line based on distance from name to last field, rather than first field
2021-08-21Make E0023 spans even more preciseNoah Lev-20/+12
2021-08-17Make spans for tuple patterns in E0023 more preciseNoah Lev-8/+16
As suggested in #86307.
2021-08-11Modify structured suggestion outputEsteban Küber-6/+6
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-04-17Move some tests to more reasonable directories - 6Caio-0/+78
2021-01-26Tweak suggestion for missing field in patternsEsteban Küber-4/+4
Account for parser recovered struct and tuple patterns to avoid invalid suggestion. Follow up to #81103.
2021-01-16don't suggest erroneous trailing comma after `..`Zack M. Davis-2/+2
In #76612, suggestions were added for missing fields in patterns. However, the suggestions are being inserted just at the end of the last field in the pattern—before any trailing comma after the last field. This resulted in the "if you don't care about missing fields" suggestion to recommend code with a trailing comma after the field ellipsis (`..,`), which is actually not legal ("`..` must be at the end and cannot have a trailing comma")! Incidentally, the doc-comment on `error_unmentioned_fields` was using `you_cant_use_this_field` as an example field name (presumably copy-paste inherited from the description of Issue #76077), but the present author found this confusing, because unmentioned fields aren't necessarily unusable. The suggested code in the diff this commit introduces to `destructuring-assignment/struct_destructure_fail.stderr` doesn't work, but it didn't work beforehand, either (because of the "found reserved identifier `_`" thing), so you can't really call it a regression; it could be fixed in a separate PR. Resolves #78511.
2021-01-12Include `..` suggestion if fields are all wildcardsCamelid-0/+8
2021-01-12Always show suggestions in their own subwindowsCamelid-8/+12
2021-01-12Only suggest `..` if more than one field is missingCamelid-20/+8
2021-01-12Specialize `..` help message for all fields vs. the restCamelid-2/+2
2021-01-12Suggest `Variant(..)` if all of the mentioned fields are `_`Camelid-4/+4
2021-01-12Suggest `_` and `..` if a pattern has too few fieldsCamelid-0/+18
For example, this code: struct S(i32, f32); let S(x) = S(0, 1.0); will make the compiler suggest either: let S(x, _) = S(0, 1.0); or: let S(x, ..) = S(0, 1.0);
2020-11-18Test drop order for (destructuring) assignmentsFabian Zaiser-0/+44
2020-11-14Add underscore expressions for destructuring assignmentsFabian Zaiser-16/+105
Co-authored-by: varkor <github@varkor.com>
2020-11-11Implement destructuring assignment for structs and slicesFabian Zaiser-30/+315
Co-authored-by: varkor <github@varkor.com>
2020-11-07Implement destructuring assignment for tuplesFabian Zaiser-39/+159
Co-authored-by: varkor <github@varkor.com>
2020-02-17Do not emit note suggesting to implement trait to foreign typeLeSeulArtichaut-4/+0
Update tests Extend to other operations Refractor check in a separate function Fix more tests
2019-12-23Add new folder for destructuring assignment testsvarkor-0/+147