rust/tests/ui/pattern/bindings-after-at
Alan Egerton 22b3f59882
Fix suppression of unused_assignment in binding of unused_variable
Unused assignments to an unused variable should trigger only the
`unused_variables` lint and not also the `unused_assignments` lint.
This was previously implemented by checking whether the span of the
assignee was within the span of the binding pattern, however that failed
to capture situations was imported from elsewhere (eg from the input
tokenstream of a proc-macro that generates the binding pattern).

By comparing the span of the assignee to those of the variable
introductions instead, a reported stable-to-stable regression is
resolved.

This fix also impacted some other preexisting tests, which had
(undesirably) been triggering both the `unused_variables` and
`unused_assignments` lints on the same initializing assignment; those
tests have therefore now been updated to expect only the former lint.
2026-01-23 22:20:52 +00:00
..
bind-by-copy-or-pat.rs lower bindings in the order they're written 2025-08-06 12:13:40 -07:00
bind-by-copy.rs Fix suppression of unused_assignment in binding of unused_variable 2026-01-23 22:20:52 +00:00
bind-by-copy.stderr Fix suppression of unused_assignment in binding of unused_variable 2026-01-23 22:20:52 +00:00
bind-by-move-neither-can-live-while-the-other-survives-1.rs
bind-by-move-neither-can-live-while-the-other-survives-1.stderr Tweak wording 2024-03-13 23:05:17 +00:00
bind-by-move-no-subbindings-fun-param.rs
bind-by-move-no-subbindings-fun-param.stderr
borrowck-move-and-move.rs Put new bindings first in refutable cases too 2024-01-25 02:56:02 +01:00
borrowck-move-and-move.stderr Put new bindings first in refutable cases too 2024-01-25 02:56:02 +01:00
borrowck-pat-at-and-box-pass.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
borrowck-pat-at-and-box.rs
borrowck-pat-at-and-box.stderr
borrowck-pat-by-copy-bindings-in-at.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
borrowck-pat-by-move-and-ref-inverse-promotion.rs
borrowck-pat-by-move-and-ref-inverse-promotion.stderr Tweak wording 2024-03-13 23:05:17 +00:00
borrowck-pat-by-move-and-ref-inverse.rs Put new bindings first in refutable cases too 2024-01-25 02:56:02 +01:00
borrowck-pat-by-move-and-ref-inverse.stderr Tweak wording 2024-03-13 23:05:17 +00:00
borrowck-pat-by-move-and-ref.rs Put new bindings first in refutable cases too 2024-01-25 02:56:02 +01:00
borrowck-pat-by-move-and-ref.stderr Put new bindings first in refutable cases too 2024-01-25 02:56:02 +01:00
borrowck-pat-ref-both-sides.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
borrowck-pat-ref-mut-and-ref.rs Put new bindings first in refutable cases too 2024-01-25 02:56:02 +01:00
borrowck-pat-ref-mut-and-ref.stderr Peel off explicit (or implicit) deref before suggesting clone on move error in borrowck 2024-07-26 14:41:56 -04:00
borrowck-pat-ref-mut-twice.rs Put new bindings first in refutable cases too 2024-01-25 02:56:02 +01:00
borrowck-pat-ref-mut-twice.stderr Tweak wording 2024-03-13 23:05:17 +00:00
box-patterns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
copy-and-move-mixed.rs
copy-and-move-mixed.stderr
default-binding-modes-both-sides-independent.rs
default-binding-modes-both-sides-independent.stderr Tweak wording 2024-03-13 23:05:17 +00:00
nested-binding-mode-lint.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
nested-binding-modes-mut.rs
nested-binding-modes-mut.stderr
nested-binding-modes-ref.rs
nested-binding-modes-ref.stderr Make E0614 a structured error 2025-02-25 16:56:04 +00:00
nested-patterns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
nested-type-ascription-syntactically-invalid.rs Use cfg(false) in UI tests 2025-04-03 21:41:58 +00:00
nested-type-ascription-syntactically-invalid.stderr Remove old diagnostic notes for type ascription syntax 2025-04-16 20:24:55 +10:00
or-patterns-box-patterns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
or-patterns-slice-patterns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
or-patterns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
pat-at-same-name-both.rs Continue to borrowck even if there were previous errors 2024-02-08 08:10:43 +00:00
pat-at-same-name-both.stderr Better span for "make binding mutable" suggestion 2024-07-04 02:02:21 +00:00
slice-patterns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
wild-before-at-syntactically-rejected.rs Use cfg(false) in UI tests 2025-04-03 21:41:58 +00:00
wild-before-at-syntactically-rejected.stderr Show diff suggestion format on verbose replacement 2025-02-10 20:21:39 +00:00