about summary refs log tree commit diff
path: root/tests/ui/pattern/bindings-after-at
AgeCommit message (Collapse)AuthorLines
2025-08-06lower bindings in the order they're writtendianne-35/+3
2025-04-17Auto merge of #139949 - matthiaskrgr:rollup-pxc5tsx, r=matthiaskrgrbors-4/+4
Rollup of 8 pull requests Successful merges: - #138632 (Stabilize `cfg_boolean_literals`) - #139416 (unstable book; document `macro_metavar_expr_concat`) - #139782 (Consistent with treating Ctor Call as Struct in liveness analysis) - #139885 (document RUSTC_BOOTSTRAP, RUSTC_OVERRIDE_VERSION_STRING, and -Z allow-features in the unstable book) - #139904 (Explicitly annotate edition for `unpretty=expanded` and `unpretty=hir` tests) - #139932 (transmutability: Refactor tests for simplicity) - #139944 (Move eager translation to a method on Diag) - #139948 (git: ignore `60600a6fa403216bfd66e04f948b1822f6450af7` for blame purposes) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-16Remove old diagnostic notes for type ascription syntaxZalathar-2/+0
Type ascription syntax was removed in 2023.
2025-04-03Use `cfg(false)` in UI testsclubby789-4/+4
2025-02-25Make E0614 a structured errorEsteban Küber-2/+2
``` error[E0614]: type `(..., ..., ..., ...)` cannot be dereferenced --> $DIR/long-E0614.rs:10:5 | LL | *x; | ^^ can't be dereferenced | = note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt' = note: consider using `--verbose` to print the full type name to the console ```
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-6/+9
``` 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; | ```
2024-11-24parse guard patternsNadrieril-2/+2
Co-authored-by: Max Niederman <max@maxniederman.com>
2024-07-26Peel off explicit (or implicit) deref before suggesting clone on move error ↵Michael Goulet-16/+0
in borrowck
2024-07-12Make parse error suggestions verbose and fix spansEsteban Küber-3/+15
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-07-04Better span for "make binding mutable" suggestionEsteban Küber-2/+2
2024-04-25Auto merge of #119650 - chenyukang:yukang-fix-118596-ref-mut, r=wesleywiserbors-4/+10
Suggest ref mut for pattern matching assignment Fixes #118596
2024-04-24Mention when type parameter could be `Clone`Esteban Küber-2/+8
``` error[E0382]: use of moved value: `t` --> $DIR/use_of_moved_value_copy_suggestions.rs:7:9 | LL | fn duplicate_t<T>(t: T) -> (T, T) { | - move occurs because `t` has type `T`, which does not implement the `Copy` trait ... LL | (t, t) | - ^ value used here after move | | | value moved here | help: if `T` implemented `Clone`, you could clone the value --> $DIR/use_of_moved_value_copy_suggestions.rs:4:16 | LL | fn duplicate_t<T>(t: T) -> (T, T) { | ^ consider constraining this type parameter with `Clone` ... LL | (t, t) | - you could clone this value help: consider restricting type parameter `T` | LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) { | ++++++ ``` The `help` is new. On ADTs, we also extend the output with span labels: ``` error[E0507]: cannot move out of static item `FOO` --> $DIR/issue-17718-static-move.rs:6:14 | LL | let _a = FOO; | ^^^ move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait | note: if `Foo` implemented `Clone`, you could clone the value --> $DIR/issue-17718-static-move.rs:1:1 | LL | struct Foo; | ^^^^^^^^^^ consider implementing `Clone` for this type ... LL | let _a = FOO; | --- you could clone this value help: consider borrowing here | LL | let _a = &FOO; | + ```
2024-04-25Suggest ref mut for pattern matching assignmentyukang-4/+10
2024-04-11Mention when the type of the moved value doesn't implement `Clone`Esteban Küber-0/+10
2024-03-13Tweak wordingEsteban Küber-33/+33
2024-03-02Rollup merge of #121716 - Nadrieril:simple-binding-order, r=matthewjasperGuillaume Boisseau-0/+48
match lowering: Lower bindings in a predictable order After the recent refactorings, we can now lower bindings in a truly predictable order. The order in https://github.com/rust-lang/rust/pull/120214 was an improvement but not very clear. With this PR, we lower bindings from left to right, with the special case that `x @ pat` is traversed as `pat @ x` (i.e. `x` is lowered after any bindings in `pat`). This description only applies in the absence of or-patterns. Or-patterns make everything complicated, because the binding place depends on the subpattern. Until I have a better idea I leave them to be handled in whatever weird order arises from today's code. r? `@matthewjasper`
2024-03-01Detect more cases of `=` to `:` typoEsteban Küber-2/+6
When a `Local` is fully parsed, but not followed by a `;`, keep the `:` span arround and mention it. If the type could continue being parsed as an expression, suggest replacing the `:` with a `=`. ``` error: expected one of `!`, `+`, `->`, `::`, `;`, or `=`, found `.` --> file.rs:2:32 | 2 | let _: std::env::temp_dir().join("foo"); | - ^ expected one of `!`, `+`, `->`, `::`, `;`, or `=` | | | while parsing the type for `_` | help: use `=` if you meant to assign ``` Fix #119665.
2024-02-28Add test for the known case that doesn't workNadrieril-0/+48
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-11/+11
2024-02-08Auto merge of #120767 - matthiaskrgr:rollup-0k8ib1c, r=matthiaskrgrbors-166/+221
Rollup of 9 pull requests Successful merges: - #119592 (resolve: Unload speculatively resolved crates before freezing cstore) - #120103 (Make it so that async-fn-in-trait is compatible with a concrete future in implementation) - #120206 (hir: Make sure all `HirId`s have corresponding HIR `Node`s) - #120214 (match lowering: consistently lower bindings deepest-first) - #120688 (GVN: also turn moves into copies with projections) - #120702 (docs: also check the inline stmt during redundant link check) - #120727 (exhaustiveness: Prefer "`0..MAX` not covered" to "`_` not covered") - #120734 (Add `SubdiagnosticMessageOp` as a trait alias.) - #120739 (improve pretty printing for associated items in trait objects) r? `@ghost` `@rustbot` modify labels: rollup
2024-02-08Continue to borrowck even if there were previous errorsOli Scherer-5/+25
2024-01-25Put new bindings first in refutable cases tooNadrieril-163/+183
2024-01-25Add testsNadrieril-6/+41
2023-11-24Show number in error message even for one errorNilstrieb-3/+3
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-10-05Add a note to duplicate diagnosticsAlex Macleod-0/+2
2023-05-21Rename `drop_ref` lint to `dropping_references`Urgau-1/+1
2023-05-21Rename `drop_copy` lint to `dropping_copy_types`Urgau-2/+2
2023-05-10Adjust tests for new drop and forget lintsUrgau-0/+5
2023-05-01Rip it outNilstrieb-9/+4
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-21Run `check_match` and `check_liveness` when MIR is built instead of having ↵Oli Scherer-207/+207
an explicit phase for them
2023-04-03Shrink binding span.Camille GILLOT-413/+273
2023-01-17Migrate mir_build's borrow conflictsmejrs-208/+208
2023-01-11Move /src/test to /testsAlbert Larsan-0/+3474