about summary refs log tree commit diff
path: root/tests/ui/closures/2229_closure_analysis/match
AgeCommit message (Collapse)AuthorLines
2025-08-19bless tests with new lint messagesKarol Zwolak-2/+2
2025-07-25Mention type that could be `Clone` but isn't in more casesEsteban Küber-0/+18
When encountering a moved value of a type that isn't `Clone` because of unmet obligations, but where all the unmet predicates reference crate-local types, mention them and suggest cloning, as we do in other cases already: ``` error[E0507]: cannot move out of `foo`, a captured variable in an `Fn` closure --> f111.rs:14:25 | 13 | fn do_stuff(foo: Option<Foo>) { | --- captured outer variable 14 | require_fn_trait(|| async { | -- ^^^^^ `foo` is moved here | | | captured by this `Fn` closure 15 | if foo.map_or(false, |f| f.foo()) { | --- | | | variable moved due to use in coroutine | move occurs because `foo` has type `Option<Foo>`, which does not implement the `Copy` trait | note: if `Foo` implemented `Clone`, you could clone the value --> f111.rs:4:1 | 4 | struct Foo; | ^^^^^^^^^^ consider implementing `Clone` for this type ... 15 | if foo.map_or(false, |f| f.foo()) { | --- you could clone this value ```
2025-04-08UI tests: add missing diagnostic kinds where possibleVadim Petrochenkov-18/+18
2024-12-12Filter empty lines, comments and delimiters from previous to last multiline ↵Esteban Küber-14/+1
span rendering
2024-11-04Remove BorrowKind glob, make names longerMichael Goulet-26/+26
2024-10-05Document things a bit more carefully, also account for coercion in ↵Michael Goulet-4/+2
check_expr_has_type_or_error
2024-05-03turn pointer_structural_match into a hard errorRalf Jung-27/+2
2024-04-10Handle more cases of value suggestionsEsteban Küber-2/+2
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-21/+21
2024-02-05update the tracking issue for structural match violationsRalf Jung-2/+2
and bless a test I missed
2024-02-05show indirect_structural_match and pointer_structural_match in future compat ↵Ralf Jung-0/+11
reports
2023-11-24Show number in error message even for one errorNilstrieb-1/+1
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-08Auto merge of #116930 - RalfJung:raw-ptr-match, r=davidtwcobors-1/+14
patterns: reject raw pointers that are not just integers Matching against `0 as *const i32` is fine, matching against `&42 as *const i32` is not. This extends the existing check against function pointers and wide pointers: we now uniformly reject all these pointer types during valtree construction, and then later lint because of that. See [here](https://github.com/rust-lang/rust/pull/116930#issuecomment-1784654073) for some more explanation and context. Also fixes https://github.com/rust-lang/rust/issues/116929. Cc `@oli-obk` `@lcnr`
2023-11-03Tweak spans for "adt defined here" noteNadrieril-2/+2
2023-10-28make pointer_structural_match warn-by-defaultRalf Jung-1/+14
2023-09-22Capture scrutinee of if let guards correctlyMatthew Jasper-0/+158
Previously we were always capturing by value.
2023-09-03Improve clarity of diagnostic message on non-exhaustive matchesSebastian Toh-1/+1
2023-08-28Add note when matching on nested non-exhaustive enumsSebastian Toh-1/+2
2023-06-15Don't capture &[T; N] when contents isn't readclubby789-18/+65
2023-05-25Always capture slice when pattern requires checking the lengthclubby789-85/+196
2023-04-21Run `check_match` and `check_liveness` when MIR is built instead of having ↵Oli Scherer-14/+14
an explicit phase for them
2023-01-11Move /src/test to /testsAlbert Larsan-0/+915