summaryrefslogtreecommitdiffstats
path: root/tests/ui/pattern
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/ui/pattern
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/ui/pattern/auxiliary/declarations-for-tuple-field-count-errors.rs (renamed from src/test/ui/pattern/auxiliary/declarations-for-tuple-field-count-errors.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/bind-by-copy.rs (renamed from src/test/ui/pattern/bindings-after-at/bind-by-copy.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.rs (renamed from src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr (renamed from src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr)0
-rw-r--r--tests/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.rs (renamed from src/test/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.stderr (renamed from src/test/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.stderr)0
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-move-and-move.rs (renamed from src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr (renamed from src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr)0
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-at-and-box-pass.rs (renamed from src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box-pass.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.rs (renamed from src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr (renamed from src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr)0
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-by-copy-bindings-in-at.rs (renamed from src/test/ui/pattern/bindings-after-at/borrowck-pat-by-copy-bindings-in-at.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.rs (renamed from src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr (renamed from src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr)0
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.rs (renamed from src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr (renamed from src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr)0
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.rs (renamed from src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr (renamed from src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr)0
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-ref-both-sides.rs (renamed from src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-both-sides.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.rs (renamed from src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr (renamed from src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr)0
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.rs (renamed from src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr (renamed from src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr)0
-rw-r--r--tests/ui/pattern/bindings-after-at/box-patterns.rs (renamed from src/test/ui/pattern/bindings-after-at/box-patterns.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/copy-and-move-mixed.rs (renamed from src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/copy-and-move-mixed.stderr (renamed from src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.stderr)0
-rw-r--r--tests/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.rs (renamed from src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr (renamed from src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr)0
-rw-r--r--tests/ui/pattern/bindings-after-at/nested-binding-mode-lint.rs (renamed from src/test/ui/pattern/bindings-after-at/nested-binding-mode-lint.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/nested-binding-modes-mut.rs (renamed from src/test/ui/pattern/bindings-after-at/nested-binding-modes-mut.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/nested-binding-modes-mut.stderr25
-rw-r--r--tests/ui/pattern/bindings-after-at/nested-binding-modes-ref.rs (renamed from src/test/ui/pattern/bindings-after-at/nested-binding-modes-ref.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/nested-binding-modes-ref.stderr (renamed from src/test/ui/pattern/bindings-after-at/nested-binding-modes-ref.stderr)0
-rw-r--r--tests/ui/pattern/bindings-after-at/nested-patterns.rs (renamed from src/test/ui/pattern/bindings-after-at/nested-patterns.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.rs (renamed from src/test/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.stderr (renamed from src/test/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.stderr)0
-rw-r--r--tests/ui/pattern/bindings-after-at/or-patterns-box-patterns.rs (renamed from src/test/ui/pattern/bindings-after-at/or-patterns-box-patterns.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/or-patterns-slice-patterns.rs (renamed from src/test/ui/pattern/bindings-after-at/or-patterns-slice-patterns.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/or-patterns.rs (renamed from src/test/ui/pattern/bindings-after-at/or-patterns.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/pat-at-same-name-both.rs (renamed from src/test/ui/pattern/bindings-after-at/pat-at-same-name-both.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/pat-at-same-name-both.stderr (renamed from src/test/ui/pattern/bindings-after-at/pat-at-same-name-both.stderr)0
-rw-r--r--tests/ui/pattern/bindings-after-at/slice-patterns.rs (renamed from src/test/ui/pattern/bindings-after-at/slice-patterns.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.rs (renamed from src/test/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.rs)0
-rw-r--r--tests/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.stderr (renamed from src/test/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.stderr)0
-rw-r--r--tests/ui/pattern/for-loop-bad-item.rs (renamed from src/test/ui/pattern/for-loop-bad-item.rs)0
-rw-r--r--tests/ui/pattern/for-loop-bad-item.stderr (renamed from src/test/ui/pattern/for-loop-bad-item.stderr)0
-rw-r--r--tests/ui/pattern/ignore-all-the-things.rs (renamed from src/test/ui/pattern/ignore-all-the-things.rs)0
-rw-r--r--tests/ui/pattern/integer-range-binding.rs (renamed from src/test/ui/pattern/integer-range-binding.rs)0
-rw-r--r--tests/ui/pattern/issue-10392.rs (renamed from src/test/ui/pattern/issue-10392.rs)0
-rw-r--r--tests/ui/pattern/issue-106552.rs7
-rw-r--r--tests/ui/pattern/issue-106552.stderr35
-rw-r--r--tests/ui/pattern/issue-11577.rs (renamed from src/test/ui/pattern/issue-11577.rs)0
-rw-r--r--tests/ui/pattern/issue-12582.rs (renamed from src/test/ui/pattern/issue-12582.rs)0
-rw-r--r--tests/ui/pattern/issue-14221.rs21
-rw-r--r--tests/ui/pattern/issue-14221.stderr32
-rw-r--r--tests/ui/pattern/issue-15080.rs (renamed from src/test/ui/pattern/issue-15080.rs)0
-rw-r--r--tests/ui/pattern/issue-17718-patterns.rs (renamed from src/test/ui/pattern/issue-17718-patterns.rs)0
-rw-r--r--tests/ui/pattern/issue-17718-patterns.stderr (renamed from src/test/ui/pattern/issue-17718-patterns.stderr)0
-rw-r--r--tests/ui/pattern/issue-22546.rs (renamed from src/test/ui/pattern/issue-22546.rs)0
-rw-r--r--tests/ui/pattern/issue-27320.rs (renamed from src/test/ui/pattern/issue-27320.rs)0
-rw-r--r--tests/ui/pattern/issue-52240.rs (renamed from src/test/ui/pattern/issue-52240.rs)0
-rw-r--r--tests/ui/pattern/issue-52240.stderr (renamed from src/test/ui/pattern/issue-52240.stderr)0
-rw-r--r--tests/ui/pattern/issue-6449.rs (renamed from src/test/ui/pattern/issue-6449.rs)0
-rw-r--r--tests/ui/pattern/issue-66270-pat-struct-parser-recovery.rs (renamed from src/test/ui/pattern/issue-66270-pat-struct-parser-recovery.rs)0
-rw-r--r--tests/ui/pattern/issue-66270-pat-struct-parser-recovery.stderr (renamed from src/test/ui/pattern/issue-66270-pat-struct-parser-recovery.stderr)0
-rw-r--r--tests/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.rs (renamed from src/test/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.rs)0
-rw-r--r--tests/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr (renamed from src/test/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr)0
-rw-r--r--tests/ui/pattern/issue-67776-match-same-name-enum-variant-refs.rs40
-rw-r--r--tests/ui/pattern/issue-67776-match-same-name-enum-variant-refs.stderr41
-rw-r--r--tests/ui/pattern/issue-68393-let-pat-assoc-constant.rs (renamed from src/test/ui/pattern/issue-68393-let-pat-assoc-constant.rs)0
-rw-r--r--tests/ui/pattern/issue-68393-let-pat-assoc-constant.stderr (renamed from src/test/ui/pattern/issue-68393-let-pat-assoc-constant.stderr)0
-rw-r--r--tests/ui/pattern/issue-72565.rs (renamed from src/test/ui/pattern/issue-72565.rs)0
-rw-r--r--tests/ui/pattern/issue-72565.stderr (renamed from src/test/ui/pattern/issue-72565.stderr)0
-rw-r--r--tests/ui/pattern/issue-72574-1.rs (renamed from src/test/ui/pattern/issue-72574-1.rs)0
-rw-r--r--tests/ui/pattern/issue-72574-1.stderr (renamed from src/test/ui/pattern/issue-72574-1.stderr)0
-rw-r--r--tests/ui/pattern/issue-72574-2.rs (renamed from src/test/ui/pattern/issue-72574-2.rs)0
-rw-r--r--tests/ui/pattern/issue-72574-2.stderr (renamed from src/test/ui/pattern/issue-72574-2.stderr)0
-rw-r--r--tests/ui/pattern/issue-74539.rs (renamed from src/test/ui/pattern/issue-74539.rs)0
-rw-r--r--tests/ui/pattern/issue-74539.stderr (renamed from src/test/ui/pattern/issue-74539.stderr)0
-rw-r--r--tests/ui/pattern/issue-74702.rs (renamed from src/test/ui/pattern/issue-74702.rs)0
-rw-r--r--tests/ui/pattern/issue-74702.stderr (renamed from src/test/ui/pattern/issue-74702.stderr)0
-rw-r--r--tests/ui/pattern/issue-74954.rs (renamed from src/test/ui/pattern/issue-74954.rs)0
-rw-r--r--tests/ui/pattern/issue-80186-mut-binding-help-suggestion.rs (renamed from src/test/ui/pattern/issue-80186-mut-binding-help-suggestion.rs)0
-rw-r--r--tests/ui/pattern/issue-80186-mut-binding-help-suggestion.stderr (renamed from src/test/ui/pattern/issue-80186-mut-binding-help-suggestion.stderr)0
-rw-r--r--tests/ui/pattern/issue-8351-1.rs (renamed from src/test/ui/pattern/issue-8351-1.rs)0
-rw-r--r--tests/ui/pattern/issue-8351-2.rs (renamed from src/test/ui/pattern/issue-8351-2.rs)0
-rw-r--r--tests/ui/pattern/issue-88074-pat-range-type-inference-err.rs (renamed from src/test/ui/pattern/issue-88074-pat-range-type-inference-err.rs)0
-rw-r--r--tests/ui/pattern/issue-88074-pat-range-type-inference-err.stderr (renamed from src/test/ui/pattern/issue-88074-pat-range-type-inference-err.stderr)0
-rw-r--r--tests/ui/pattern/issue-88074-pat-range-type-inference.rs (renamed from src/test/ui/pattern/issue-88074-pat-range-type-inference.rs)0
-rw-r--r--tests/ui/pattern/issue-92074-macro-ice.rs (renamed from src/test/ui/pattern/issue-92074-macro-ice.rs)0
-rw-r--r--tests/ui/pattern/issue-92074-macro-ice.stderr (renamed from src/test/ui/pattern/issue-92074-macro-ice.stderr)0
-rw-r--r--tests/ui/pattern/issue-95878.rs (renamed from src/test/ui/pattern/issue-95878.rs)0
-rw-r--r--tests/ui/pattern/issue-95878.stderr (renamed from src/test/ui/pattern/issue-95878.stderr)0
-rw-r--r--tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern-pass.rs (renamed from src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern-pass.rs)0
-rw-r--r--tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.rs (renamed from src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.rs)0
-rw-r--r--tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr (renamed from src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr)16
-rw-r--r--tests/ui/pattern/move-ref-patterns/by-move-sub-pat-unreachable.rs (renamed from src/test/ui/pattern/move-ref-patterns/by-move-sub-pat-unreachable.rs)0
-rw-r--r--tests/ui/pattern/move-ref-patterns/issue-53840.rs (renamed from src/test/ui/pattern/move-ref-patterns/issue-53840.rs)0
-rw-r--r--tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.rs (renamed from src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.rs)0
-rw-r--r--tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.stderr (renamed from src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.stderr)0
-rw-r--r--tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-pass.rs (renamed from src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-pass.rs)0
-rw-r--r--tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.rs (renamed from src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.rs)0
-rw-r--r--tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr (renamed from src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr)0
-rw-r--r--tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes-fixable.fixed12
-rw-r--r--tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes-fixable.rs12
-rw-r--r--tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes-fixable.stderr17
-rw-r--r--tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes.rs10
-rw-r--r--tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes.stderr17
-rw-r--r--tests/ui/pattern/move-ref-patterns/move-ref-patterns-dynamic-semantics.rs (renamed from src/test/ui/pattern/move-ref-patterns/move-ref-patterns-dynamic-semantics.rs)0
-rw-r--r--tests/ui/pattern/non-constant-in-const-path.rs (renamed from src/test/ui/pattern/non-constant-in-const-path.rs)0
-rw-r--r--tests/ui/pattern/non-constant-in-const-path.stderr (renamed from src/test/ui/pattern/non-constant-in-const-path.stderr)0
-rw-r--r--tests/ui/pattern/non-structural-match-types.rs (renamed from src/test/ui/pattern/non-structural-match-types.rs)0
-rw-r--r--tests/ui/pattern/non-structural-match-types.stderr (renamed from src/test/ui/pattern/non-structural-match-types.stderr)0
-rw-r--r--tests/ui/pattern/pat-shadow-in-nested-binding.rs (renamed from src/test/ui/pattern/pat-shadow-in-nested-binding.rs)0
-rw-r--r--tests/ui/pattern/pat-shadow-in-nested-binding.stderr (renamed from src/test/ui/pattern/pat-shadow-in-nested-binding.stderr)0
-rw-r--r--tests/ui/pattern/pat-struct-field-expr-has-type.rs (renamed from src/test/ui/pattern/pat-struct-field-expr-has-type.rs)0
-rw-r--r--tests/ui/pattern/pat-struct-field-expr-has-type.stderr (renamed from src/test/ui/pattern/pat-struct-field-expr-has-type.stderr)0
-rw-r--r--tests/ui/pattern/pat-tuple-bad-type.rs (renamed from src/test/ui/pattern/pat-tuple-bad-type.rs)0
-rw-r--r--tests/ui/pattern/pat-tuple-bad-type.stderr (renamed from src/test/ui/pattern/pat-tuple-bad-type.stderr)4
-rw-r--r--tests/ui/pattern/pat-tuple-field-count-cross.rs (renamed from src/test/ui/pattern/pat-tuple-field-count-cross.rs)0
-rw-r--r--tests/ui/pattern/pat-tuple-field-count-cross.stderr (renamed from src/test/ui/pattern/pat-tuple-field-count-cross.stderr)0
-rw-r--r--tests/ui/pattern/pat-tuple-overfield.rs (renamed from src/test/ui/pattern/pat-tuple-overfield.rs)0
-rw-r--r--tests/ui/pattern/pat-tuple-overfield.stderr (renamed from src/test/ui/pattern/pat-tuple-overfield.stderr)0
-rw-r--r--tests/ui/pattern/pat-tuple-underfield.rs (renamed from src/test/ui/pattern/pat-tuple-underfield.rs)0
-rw-r--r--tests/ui/pattern/pat-tuple-underfield.stderr (renamed from src/test/ui/pattern/pat-tuple-underfield.stderr)0
-rw-r--r--tests/ui/pattern/pat-type-err-formal-param.rs (renamed from src/test/ui/pattern/pat-type-err-formal-param.rs)0
-rw-r--r--tests/ui/pattern/pat-type-err-formal-param.stderr (renamed from src/test/ui/pattern/pat-type-err-formal-param.stderr)0
-rw-r--r--tests/ui/pattern/pat-type-err-let-stmt.rs (renamed from src/test/ui/pattern/pat-type-err-let-stmt.rs)0
-rw-r--r--tests/ui/pattern/pat-type-err-let-stmt.stderr (renamed from src/test/ui/pattern/pat-type-err-let-stmt.stderr)0
-rw-r--r--tests/ui/pattern/patkind-litrange-no-expr.rs (renamed from src/test/ui/pattern/patkind-litrange-no-expr.rs)0
-rw-r--r--tests/ui/pattern/patkind-litrange-no-expr.stderr (renamed from src/test/ui/pattern/patkind-litrange-no-expr.stderr)0
-rw-r--r--tests/ui/pattern/pattern-binding-disambiguation.rs (renamed from src/test/ui/pattern/pattern-binding-disambiguation.rs)0
-rw-r--r--tests/ui/pattern/pattern-binding-disambiguation.stderr (renamed from src/test/ui/pattern/pattern-binding-disambiguation.stderr)0
-rw-r--r--tests/ui/pattern/pattern-error-continue.rs (renamed from src/test/ui/pattern/pattern-error-continue.rs)0
-rw-r--r--tests/ui/pattern/pattern-error-continue.stderr (renamed from src/test/ui/pattern/pattern-error-continue.stderr)0
-rw-r--r--tests/ui/pattern/pattern-ident-path-generics.rs (renamed from src/test/ui/pattern/pattern-ident-path-generics.rs)0
-rw-r--r--tests/ui/pattern/pattern-ident-path-generics.stderr (renamed from src/test/ui/pattern/pattern-ident-path-generics.stderr)0
-rw-r--r--tests/ui/pattern/pattern-tyvar-2.rs (renamed from src/test/ui/pattern/pattern-tyvar-2.rs)0
-rw-r--r--tests/ui/pattern/pattern-tyvar-2.stderr (renamed from src/test/ui/pattern/pattern-tyvar-2.stderr)0
-rw-r--r--tests/ui/pattern/pattern-tyvar.rs (renamed from src/test/ui/pattern/pattern-tyvar.rs)0
-rw-r--r--tests/ui/pattern/pattern-tyvar.stderr (renamed from src/test/ui/pattern/pattern-tyvar.stderr)0
-rw-r--r--tests/ui/pattern/rest-pat-semantic-disallowed.rs (renamed from src/test/ui/pattern/rest-pat-semantic-disallowed.rs)0
-rw-r--r--tests/ui/pattern/rest-pat-semantic-disallowed.stderr (renamed from src/test/ui/pattern/rest-pat-semantic-disallowed.stderr)4
-rw-r--r--tests/ui/pattern/rest-pat-syntactic.rs (renamed from src/test/ui/pattern/rest-pat-syntactic.rs)0
-rw-r--r--tests/ui/pattern/rest-pat-syntactic.stderr (renamed from src/test/ui/pattern/rest-pat-syntactic.stderr)0
-rw-r--r--tests/ui/pattern/size-and-align.rs (renamed from src/test/ui/pattern/size-and-align.rs)0
-rw-r--r--tests/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.fixed (renamed from src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.fixed)0
-rw-r--r--tests/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.rs (renamed from src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.rs)0
-rw-r--r--tests/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr (renamed from src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr)7
-rw-r--r--tests/ui/pattern/usefulness/always-inhabited-union-ref.rs (renamed from src/test/ui/pattern/usefulness/always-inhabited-union-ref.rs)0
-rw-r--r--tests/ui/pattern/usefulness/always-inhabited-union-ref.stderr (renamed from src/test/ui/pattern/usefulness/always-inhabited-union-ref.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/auxiliary/empty.rs (renamed from src/test/ui/pattern/usefulness/auxiliary/empty.rs)0
-rw-r--r--tests/ui/pattern/usefulness/auxiliary/hidden.rs (renamed from src/test/ui/pattern/usefulness/auxiliary/hidden.rs)0
-rw-r--r--tests/ui/pattern/usefulness/auxiliary/unstable.rs (renamed from src/test/ui/pattern/usefulness/auxiliary/unstable.rs)0
-rw-r--r--tests/ui/pattern/usefulness/const-partial_eq-fallback-ice.rs (renamed from src/test/ui/pattern/usefulness/const-partial_eq-fallback-ice.rs)0
-rw-r--r--tests/ui/pattern/usefulness/const-partial_eq-fallback-ice.stderr (renamed from src/test/ui/pattern/usefulness/const-partial_eq-fallback-ice.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/const-pat-ice.rs (renamed from src/test/ui/pattern/usefulness/const-pat-ice.rs)0
-rw-r--r--tests/ui/pattern/usefulness/const-private-fields.rs (renamed from src/test/ui/pattern/usefulness/const-private-fields.rs)0
-rw-r--r--tests/ui/pattern/usefulness/consts-opaque.rs (renamed from src/test/ui/pattern/usefulness/consts-opaque.rs)0
-rw-r--r--tests/ui/pattern/usefulness/consts-opaque.stderr (renamed from src/test/ui/pattern/usefulness/consts-opaque.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/deny-irrefutable-let-patterns.rs (renamed from src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.rs)0
-rw-r--r--tests/ui/pattern/usefulness/deny-irrefutable-let-patterns.stderr (renamed from src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/doc-hidden-fields.rs (renamed from src/test/ui/pattern/usefulness/doc-hidden-fields.rs)0
-rw-r--r--tests/ui/pattern/usefulness/doc-hidden-fields.stderr (renamed from src/test/ui/pattern/usefulness/doc-hidden-fields.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/doc-hidden-non-exhaustive.rs (renamed from src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.rs)0
-rw-r--r--tests/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr (renamed from src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr)7
-rw-r--r--tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr (renamed from src/test/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/empty-match.normal.stderr (renamed from src/test/ui/pattern/usefulness/empty-match.normal.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/empty-match.rs (renamed from src/test/ui/pattern/usefulness/empty-match.rs)0
-rw-r--r--tests/ui/pattern/usefulness/floats.rs (renamed from src/test/ui/pattern/usefulness/floats.rs)0
-rw-r--r--tests/ui/pattern/usefulness/floats.stderr (renamed from src/test/ui/pattern/usefulness/floats.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/guards.rs (renamed from src/test/ui/pattern/usefulness/guards.rs)0
-rw-r--r--tests/ui/pattern/usefulness/guards.stderr (renamed from src/test/ui/pattern/usefulness/guards.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/integer-ranges/exhaustiveness.rs (renamed from src/test/ui/pattern/usefulness/integer-ranges/exhaustiveness.rs)0
-rw-r--r--tests/ui/pattern/usefulness/integer-ranges/exhaustiveness.stderr (renamed from src/test/ui/pattern/usefulness/integer-ranges/exhaustiveness.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/integer-ranges/overlapping_range_endpoints.rs (renamed from src/test/ui/pattern/usefulness/integer-ranges/overlapping_range_endpoints.rs)0
-rw-r--r--tests/ui/pattern/usefulness/integer-ranges/overlapping_range_endpoints.stderr (renamed from src/test/ui/pattern/usefulness/integer-ranges/overlapping_range_endpoints.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.allow.stderr (renamed from src/test/ui/pattern/usefulness/integer-ranges/pointer-sized-int.allow.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr (renamed from src/test/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.rs (renamed from src/test/ui/pattern/usefulness/integer-ranges/pointer-sized-int.rs)0
-rw-r--r--tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.rs (renamed from src/test/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.rs)0
-rw-r--r--tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.stderr (renamed from src/test/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/integer-ranges/reachability.rs (renamed from src/test/ui/pattern/usefulness/integer-ranges/reachability.rs)0
-rw-r--r--tests/ui/pattern/usefulness/integer-ranges/reachability.stderr (renamed from src/test/ui/pattern/usefulness/integer-ranges/reachability.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/irrefutable-let-patterns.rs (renamed from src/test/ui/pattern/usefulness/irrefutable-let-patterns.rs)0
-rw-r--r--tests/ui/pattern/usefulness/irrefutable-unit.rs (renamed from src/test/ui/pattern/usefulness/irrefutable-unit.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-12116.rs (renamed from src/test/ui/pattern/usefulness/issue-12116.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-12116.stderr (renamed from src/test/ui/pattern/usefulness/issue-12116.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/issue-12369.rs (renamed from src/test/ui/pattern/usefulness/issue-12369.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-12369.stderr (renamed from src/test/ui/pattern/usefulness/issue-12369.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/issue-13727.rs (renamed from src/test/ui/pattern/usefulness/issue-13727.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-13727.stderr (renamed from src/test/ui/pattern/usefulness/issue-13727.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/issue-15129.rs (renamed from src/test/ui/pattern/usefulness/issue-15129.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-15129.stderr (renamed from src/test/ui/pattern/usefulness/issue-15129.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/issue-2111.rs (renamed from src/test/ui/pattern/usefulness/issue-2111.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-2111.stderr (renamed from src/test/ui/pattern/usefulness/issue-2111.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/issue-30240-b.rs (renamed from src/test/ui/pattern/usefulness/issue-30240-b.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-30240-b.stderr (renamed from src/test/ui/pattern/usefulness/issue-30240-b.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/issue-30240-rpass.rs (renamed from src/test/ui/pattern/usefulness/issue-30240-rpass.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-30240.rs (renamed from src/test/ui/pattern/usefulness/issue-30240.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-30240.stderr (renamed from src/test/ui/pattern/usefulness/issue-30240.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/issue-3096-1.rs (renamed from src/test/ui/pattern/usefulness/issue-3096-1.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-3096-1.stderr (renamed from src/test/ui/pattern/usefulness/issue-3096-1.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/issue-3096-2.rs (renamed from src/test/ui/pattern/usefulness/issue-3096-2.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-3096-2.stderr (renamed from src/test/ui/pattern/usefulness/issue-3096-2.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/issue-31221.rs (renamed from src/test/ui/pattern/usefulness/issue-31221.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-31221.stderr (renamed from src/test/ui/pattern/usefulness/issue-31221.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/issue-31561.rs11
-rw-r--r--tests/ui/pattern/usefulness/issue-31561.stderr27
-rw-r--r--tests/ui/pattern/usefulness/issue-35609.rs (renamed from src/test/ui/pattern/usefulness/issue-35609.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-35609.stderr (renamed from src/test/ui/pattern/usefulness/issue-35609.stderr)3
-rw-r--r--tests/ui/pattern/usefulness/issue-3601.rs (renamed from src/test/ui/pattern/usefulness/issue-3601.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-3601.stderr (renamed from src/test/ui/pattern/usefulness/issue-3601.stderr)6
-rw-r--r--tests/ui/pattern/usefulness/issue-39362.rs (renamed from src/test/ui/pattern/usefulness/issue-39362.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-39362.stderr (renamed from src/test/ui/pattern/usefulness/issue-39362.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/issue-40221.rs (renamed from src/test/ui/pattern/usefulness/issue-40221.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-40221.stderr (renamed from src/test/ui/pattern/usefulness/issue-40221.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/issue-4321.rs (renamed from src/test/ui/pattern/usefulness/issue-4321.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-4321.stderr (renamed from src/test/ui/pattern/usefulness/issue-4321.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/issue-50900.rs (renamed from src/test/ui/pattern/usefulness/issue-50900.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-50900.stderr (renamed from src/test/ui/pattern/usefulness/issue-50900.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/issue-53820-slice-pattern-large-array.rs (renamed from src/test/ui/pattern/usefulness/issue-53820-slice-pattern-large-array.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-56379.rs (renamed from src/test/ui/pattern/usefulness/issue-56379.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-56379.stderr (renamed from src/test/ui/pattern/usefulness/issue-56379.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/issue-57472.rs (renamed from src/test/ui/pattern/usefulness/issue-57472.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-57472.stderr (renamed from src/test/ui/pattern/usefulness/issue-57472.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/issue-65413-constants-and-slices-exhaustiveness.rs (renamed from src/test/ui/pattern/usefulness/issue-65413-constants-and-slices-exhaustiveness.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-66501.rs (renamed from src/test/ui/pattern/usefulness/issue-66501.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-71930-type-of-match-scrutinee.rs (renamed from src/test/ui/pattern/usefulness/issue-71930-type-of-match-scrutinee.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-72377.rs (renamed from src/test/ui/pattern/usefulness/issue-72377.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-72377.stderr (renamed from src/test/ui/pattern/usefulness/issue-72377.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/issue-72476-and-89393-associated-type.rs (renamed from src/test/ui/pattern/usefulness/issue-72476-and-89393-associated-type.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.rs (renamed from src/test/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.stderr (renamed from src/test/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/issue-78549-ref-pat-and-str.rs (renamed from src/test/ui/pattern/usefulness/issue-78549-ref-pat-and-str.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-80501-or-pat-and-macro.rs (renamed from src/test/ui/pattern/usefulness/issue-80501-or-pat-and-macro.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-82772-match-box-as-struct.rs (renamed from src/test/ui/pattern/usefulness/issue-82772-match-box-as-struct.rs)0
-rw-r--r--tests/ui/pattern/usefulness/issue-82772-match-box-as-struct.stderr (renamed from src/test/ui/pattern/usefulness/issue-82772-match-box-as-struct.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/issue-88747.rs (renamed from src/test/ui/pattern/usefulness/issue-88747.rs)0
-rw-r--r--tests/ui/pattern/usefulness/match-arm-statics-2.rs (renamed from src/test/ui/pattern/usefulness/match-arm-statics-2.rs)0
-rw-r--r--tests/ui/pattern/usefulness/match-arm-statics-2.stderr (renamed from src/test/ui/pattern/usefulness/match-arm-statics-2.stderr)12
-rw-r--r--tests/ui/pattern/usefulness/match-arm-statics.rs (renamed from src/test/ui/pattern/usefulness/match-arm-statics.rs)0
-rw-r--r--tests/ui/pattern/usefulness/match-arm-statics.stderr (renamed from src/test/ui/pattern/usefulness/match-arm-statics.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/match-byte-array-patterns-2.rs (renamed from src/test/ui/pattern/usefulness/match-byte-array-patterns-2.rs)0
-rw-r--r--tests/ui/pattern/usefulness/match-byte-array-patterns-2.stderr (renamed from src/test/ui/pattern/usefulness/match-byte-array-patterns-2.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/match-byte-array-patterns.rs (renamed from src/test/ui/pattern/usefulness/match-byte-array-patterns.rs)0
-rw-r--r--tests/ui/pattern/usefulness/match-byte-array-patterns.stderr (renamed from src/test/ui/pattern/usefulness/match-byte-array-patterns.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/match-non-exhaustive.rs (renamed from src/test/ui/pattern/usefulness/match-non-exhaustive.rs)0
-rw-r--r--tests/ui/pattern/usefulness/match-non-exhaustive.stderr (renamed from src/test/ui/pattern/usefulness/match-non-exhaustive.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/match-privately-empty.rs (renamed from src/test/ui/pattern/usefulness/match-privately-empty.rs)0
-rw-r--r--tests/ui/pattern/usefulness/match-privately-empty.stderr (renamed from src/test/ui/pattern/usefulness/match-privately-empty.stderr)7
-rw-r--r--tests/ui/pattern/usefulness/match-ref-ice.rs (renamed from src/test/ui/pattern/usefulness/match-ref-ice.rs)0
-rw-r--r--tests/ui/pattern/usefulness/match-ref-ice.stderr (renamed from src/test/ui/pattern/usefulness/match-ref-ice.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/match-slice-patterns.rs (renamed from src/test/ui/pattern/usefulness/match-slice-patterns.rs)0
-rw-r--r--tests/ui/pattern/usefulness/match-slice-patterns.stderr (renamed from src/test/ui/pattern/usefulness/match-slice-patterns.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/match-vec-fixed.rs (renamed from src/test/ui/pattern/usefulness/match-vec-fixed.rs)0
-rw-r--r--tests/ui/pattern/usefulness/match-vec-fixed.stderr (renamed from src/test/ui/pattern/usefulness/match-vec-fixed.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/match-vec-unreachable.rs (renamed from src/test/ui/pattern/usefulness/match-vec-unreachable.rs)0
-rw-r--r--tests/ui/pattern/usefulness/match-vec-unreachable.stderr (renamed from src/test/ui/pattern/usefulness/match-vec-unreachable.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/nested-exhaustive-match.rs (renamed from src/test/ui/pattern/usefulness/nested-exhaustive-match.rs)0
-rw-r--r--tests/ui/pattern/usefulness/non-exhaustive-defined-here.rs107
-rw-r--r--tests/ui/pattern/usefulness/non-exhaustive-defined-here.stderr (renamed from src/test/ui/pattern/usefulness/non-exhaustive-defined-here.stderr)58
-rw-r--r--tests/ui/pattern/usefulness/non-exhaustive-match-nested.rs (renamed from src/test/ui/pattern/usefulness/non-exhaustive-match-nested.rs)0
-rw-r--r--tests/ui/pattern/usefulness/non-exhaustive-match-nested.stderr (renamed from src/test/ui/pattern/usefulness/non-exhaustive-match-nested.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/non-exhaustive-match.rs (renamed from src/test/ui/pattern/usefulness/non-exhaustive-match.rs)0
-rw-r--r--tests/ui/pattern/usefulness/non-exhaustive-match.stderr (renamed from src/test/ui/pattern/usefulness/non-exhaustive-match.stderr)7
-rw-r--r--tests/ui/pattern/usefulness/non-exhaustive-pattern-witness.rs (renamed from src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.rs)0
-rw-r--r--tests/ui/pattern/usefulness/non-exhaustive-pattern-witness.stderr (renamed from src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/refutable-pattern-errors.rs9
-rw-r--r--tests/ui/pattern/usefulness/refutable-pattern-errors.stderr (renamed from src/test/ui/pattern/usefulness/refutable-pattern-errors.stderr)6
-rw-r--r--tests/ui/pattern/usefulness/refutable-pattern-in-fn-arg.rs6
-rw-r--r--tests/ui/pattern/usefulness/refutable-pattern-in-fn-arg.stderr (renamed from src/test/ui/pattern/usefulness/refutable-pattern-in-fn-arg.stderr)2
-rw-r--r--tests/ui/pattern/usefulness/slice-pattern-const-2.rs (renamed from src/test/ui/pattern/usefulness/slice-pattern-const-2.rs)0
-rw-r--r--tests/ui/pattern/usefulness/slice-pattern-const-2.stderr (renamed from src/test/ui/pattern/usefulness/slice-pattern-const-2.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/slice-pattern-const-3.rs (renamed from src/test/ui/pattern/usefulness/slice-pattern-const-3.rs)0
-rw-r--r--tests/ui/pattern/usefulness/slice-pattern-const-3.stderr (renamed from src/test/ui/pattern/usefulness/slice-pattern-const-3.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/slice-pattern-const.rs (renamed from src/test/ui/pattern/usefulness/slice-pattern-const.rs)0
-rw-r--r--tests/ui/pattern/usefulness/slice-pattern-const.stderr (renamed from src/test/ui/pattern/usefulness/slice-pattern-const.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/slice-patterns-exhaustiveness.rs (renamed from src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.rs)0
-rw-r--r--tests/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr (renamed from src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/slice-patterns-irrefutable.rs (renamed from src/test/ui/pattern/usefulness/slice-patterns-irrefutable.rs)0
-rw-r--r--tests/ui/pattern/usefulness/slice-patterns-reachability.rs (renamed from src/test/ui/pattern/usefulness/slice-patterns-reachability.rs)0
-rw-r--r--tests/ui/pattern/usefulness/slice-patterns-reachability.stderr (renamed from src/test/ui/pattern/usefulness/slice-patterns-reachability.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/stable-gated-fields.rs (renamed from src/test/ui/pattern/usefulness/stable-gated-fields.rs)0
-rw-r--r--tests/ui/pattern/usefulness/stable-gated-fields.stderr (renamed from src/test/ui/pattern/usefulness/stable-gated-fields.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/stable-gated-patterns.rs (renamed from src/test/ui/pattern/usefulness/stable-gated-patterns.rs)0
-rw-r--r--tests/ui/pattern/usefulness/stable-gated-patterns.stderr (renamed from src/test/ui/pattern/usefulness/stable-gated-patterns.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/struct-like-enum-nonexhaustive.rs (renamed from src/test/ui/pattern/usefulness/struct-like-enum-nonexhaustive.rs)0
-rw-r--r--tests/ui/pattern/usefulness/struct-like-enum-nonexhaustive.stderr (renamed from src/test/ui/pattern/usefulness/struct-like-enum-nonexhaustive.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/struct-pattern-match-useless.rs (renamed from src/test/ui/pattern/usefulness/struct-pattern-match-useless.rs)0
-rw-r--r--tests/ui/pattern/usefulness/struct-pattern-match-useless.stderr (renamed from src/test/ui/pattern/usefulness/struct-pattern-match-useless.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/top-level-alternation.rs (renamed from src/test/ui/pattern/usefulness/top-level-alternation.rs)0
-rw-r--r--tests/ui/pattern/usefulness/top-level-alternation.stderr (renamed from src/test/ui/pattern/usefulness/top-level-alternation.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/tuple-struct-nonexhaustive.rs (renamed from src/test/ui/pattern/usefulness/tuple-struct-nonexhaustive.rs)0
-rw-r--r--tests/ui/pattern/usefulness/tuple-struct-nonexhaustive.stderr (renamed from src/test/ui/pattern/usefulness/tuple-struct-nonexhaustive.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/type_polymorphic_byte_str_literals.rs (renamed from src/test/ui/pattern/usefulness/type_polymorphic_byte_str_literals.rs)0
-rw-r--r--tests/ui/pattern/usefulness/type_polymorphic_byte_str_literals.stderr (renamed from src/test/ui/pattern/usefulness/type_polymorphic_byte_str_literals.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/uninhabited.rs (renamed from src/test/ui/pattern/usefulness/uninhabited.rs)0
-rw-r--r--tests/ui/pattern/usefulness/unstable-gated-fields.rs (renamed from src/test/ui/pattern/usefulness/unstable-gated-fields.rs)0
-rw-r--r--tests/ui/pattern/usefulness/unstable-gated-fields.stderr (renamed from src/test/ui/pattern/usefulness/unstable-gated-fields.stderr)0
-rw-r--r--tests/ui/pattern/usefulness/unstable-gated-patterns.rs (renamed from src/test/ui/pattern/usefulness/unstable-gated-patterns.rs)0
-rw-r--r--tests/ui/pattern/usefulness/unstable-gated-patterns.stderr (renamed from src/test/ui/pattern/usefulness/unstable-gated-patterns.stderr)0
302 files changed, 486 insertions, 82 deletions
diff --git a/src/test/ui/pattern/auxiliary/declarations-for-tuple-field-count-errors.rs b/tests/ui/pattern/auxiliary/declarations-for-tuple-field-count-errors.rs
index f7373c453..f7373c453 100644
--- a/src/test/ui/pattern/auxiliary/declarations-for-tuple-field-count-errors.rs
+++ b/tests/ui/pattern/auxiliary/declarations-for-tuple-field-count-errors.rs
diff --git a/src/test/ui/pattern/bindings-after-at/bind-by-copy.rs b/tests/ui/pattern/bindings-after-at/bind-by-copy.rs
index 2b349f0ed..2b349f0ed 100644
--- a/src/test/ui/pattern/bindings-after-at/bind-by-copy.rs
+++ b/tests/ui/pattern/bindings-after-at/bind-by-copy.rs
diff --git a/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.rs b/tests/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.rs
index 9d1f08d6e..9d1f08d6e 100644
--- a/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.rs
+++ b/tests/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.rs
diff --git a/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr b/tests/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr
index c8b45fd24..c8b45fd24 100644
--- a/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr
+++ b/tests/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr
diff --git a/src/test/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.rs b/tests/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.rs
index 1816a74a0..1816a74a0 100644
--- a/src/test/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.rs
+++ b/tests/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.rs
diff --git a/src/test/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.stderr b/tests/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.stderr
index a481ca468..a481ca468 100644
--- a/src/test/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.stderr
+++ b/tests/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.stderr
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.rs b/tests/ui/pattern/bindings-after-at/borrowck-move-and-move.rs
index a61d68215..a61d68215 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.rs
+++ b/tests/ui/pattern/bindings-after-at/borrowck-move-and-move.rs
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr b/tests/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr
index 324897151..324897151 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr
+++ b/tests/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box-pass.rs b/tests/ui/pattern/bindings-after-at/borrowck-pat-at-and-box-pass.rs
index fbdefd9d3..fbdefd9d3 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box-pass.rs
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-at-and-box-pass.rs
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.rs b/tests/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.rs
index 45aa65e67..45aa65e67 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.rs
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.rs
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr b/tests/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr
index f27df32cc..f27df32cc 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-copy-bindings-in-at.rs b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-copy-bindings-in-at.rs
index 0108861cf..0108861cf 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-copy-bindings-in-at.rs
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-copy-bindings-in-at.rs
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.rs b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.rs
index 82f16fca6..82f16fca6 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.rs
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.rs
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr
index d6474f1b4..d6474f1b4 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.rs b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.rs
index 06dc6e1c4..06dc6e1c4 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.rs
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.rs
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr
index 389e86e64..389e86e64 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.rs b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.rs
index 0b0a78010..0b0a78010 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.rs
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.rs
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr
index 770bb8953..770bb8953 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-both-sides.rs b/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-both-sides.rs
index df213f688..df213f688 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-both-sides.rs
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-both-sides.rs
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.rs b/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.rs
index 6bc0d346c..6bc0d346c 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.rs
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.rs
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr b/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr
index 8546b4bb4..8546b4bb4 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.rs b/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.rs
index 99739c7bc..99739c7bc 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.rs
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.rs
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr b/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
index ad4ce7952..ad4ce7952 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
diff --git a/src/test/ui/pattern/bindings-after-at/box-patterns.rs b/tests/ui/pattern/bindings-after-at/box-patterns.rs
index 9db37253c..9db37253c 100644
--- a/src/test/ui/pattern/bindings-after-at/box-patterns.rs
+++ b/tests/ui/pattern/bindings-after-at/box-patterns.rs
diff --git a/src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.rs b/tests/ui/pattern/bindings-after-at/copy-and-move-mixed.rs
index 1e2c2968c..1e2c2968c 100644
--- a/src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.rs
+++ b/tests/ui/pattern/bindings-after-at/copy-and-move-mixed.rs
diff --git a/src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.stderr b/tests/ui/pattern/bindings-after-at/copy-and-move-mixed.stderr
index e0e623fa5..e0e623fa5 100644
--- a/src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.stderr
+++ b/tests/ui/pattern/bindings-after-at/copy-and-move-mixed.stderr
diff --git a/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.rs b/tests/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.rs
index dfd4d0285..dfd4d0285 100644
--- a/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.rs
+++ b/tests/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.rs
diff --git a/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr b/tests/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr
index 638bdd6db..638bdd6db 100644
--- a/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr
+++ b/tests/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr
diff --git a/src/test/ui/pattern/bindings-after-at/nested-binding-mode-lint.rs b/tests/ui/pattern/bindings-after-at/nested-binding-mode-lint.rs
index fe7d1eba1..fe7d1eba1 100644
--- a/src/test/ui/pattern/bindings-after-at/nested-binding-mode-lint.rs
+++ b/tests/ui/pattern/bindings-after-at/nested-binding-mode-lint.rs
diff --git a/src/test/ui/pattern/bindings-after-at/nested-binding-modes-mut.rs b/tests/ui/pattern/bindings-after-at/nested-binding-modes-mut.rs
index e7d99534d..e7d99534d 100644
--- a/src/test/ui/pattern/bindings-after-at/nested-binding-modes-mut.rs
+++ b/tests/ui/pattern/bindings-after-at/nested-binding-modes-mut.rs
diff --git a/tests/ui/pattern/bindings-after-at/nested-binding-modes-mut.stderr b/tests/ui/pattern/bindings-after-at/nested-binding-modes-mut.stderr
new file mode 100644
index 000000000..54118dc36
--- /dev/null
+++ b/tests/ui/pattern/bindings-after-at/nested-binding-modes-mut.stderr
@@ -0,0 +1,25 @@
+error[E0596]: cannot borrow `not_mut` as mutable, as it is not declared as mutable
+ --> $DIR/nested-binding-modes-mut.rs:4:5
+ |
+LL | &mut not_mut;
+ | ^^^^^^^^^^^^ cannot borrow as mutable
+ |
+help: consider changing this to be mutable
+ |
+LL | let mut is_mut @ mut not_mut = 42;
+ | +++
+
+error[E0596]: cannot borrow `not_mut` as mutable, as it is not declared as mutable
+ --> $DIR/nested-binding-modes-mut.rs:9:5
+ |
+LL | &mut not_mut;
+ | ^^^^^^^^^^^^ cannot borrow as mutable
+ |
+help: consider changing this to be mutable
+ |
+LL | let mut not_mut @ mut is_mut = 42;
+ | +++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0596`.
diff --git a/src/test/ui/pattern/bindings-after-at/nested-binding-modes-ref.rs b/tests/ui/pattern/bindings-after-at/nested-binding-modes-ref.rs
index adfb0387f..adfb0387f 100644
--- a/src/test/ui/pattern/bindings-after-at/nested-binding-modes-ref.rs
+++ b/tests/ui/pattern/bindings-after-at/nested-binding-modes-ref.rs
diff --git a/src/test/ui/pattern/bindings-after-at/nested-binding-modes-ref.stderr b/tests/ui/pattern/bindings-after-at/nested-binding-modes-ref.stderr
index b378fe356..b378fe356 100644
--- a/src/test/ui/pattern/bindings-after-at/nested-binding-modes-ref.stderr
+++ b/tests/ui/pattern/bindings-after-at/nested-binding-modes-ref.stderr
diff --git a/src/test/ui/pattern/bindings-after-at/nested-patterns.rs b/tests/ui/pattern/bindings-after-at/nested-patterns.rs
index f06563d56..f06563d56 100644
--- a/src/test/ui/pattern/bindings-after-at/nested-patterns.rs
+++ b/tests/ui/pattern/bindings-after-at/nested-patterns.rs
diff --git a/src/test/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.rs b/tests/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.rs
index a709e34b5..a709e34b5 100644
--- a/src/test/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.rs
+++ b/tests/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.rs
diff --git a/src/test/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.stderr b/tests/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.stderr
index 27660ae40..27660ae40 100644
--- a/src/test/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.stderr
+++ b/tests/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.stderr
diff --git a/src/test/ui/pattern/bindings-after-at/or-patterns-box-patterns.rs b/tests/ui/pattern/bindings-after-at/or-patterns-box-patterns.rs
index 383e377a5..383e377a5 100644
--- a/src/test/ui/pattern/bindings-after-at/or-patterns-box-patterns.rs
+++ b/tests/ui/pattern/bindings-after-at/or-patterns-box-patterns.rs
diff --git a/src/test/ui/pattern/bindings-after-at/or-patterns-slice-patterns.rs b/tests/ui/pattern/bindings-after-at/or-patterns-slice-patterns.rs
index d315f7ee3..d315f7ee3 100644
--- a/src/test/ui/pattern/bindings-after-at/or-patterns-slice-patterns.rs
+++ b/tests/ui/pattern/bindings-after-at/or-patterns-slice-patterns.rs
diff --git a/src/test/ui/pattern/bindings-after-at/or-patterns.rs b/tests/ui/pattern/bindings-after-at/or-patterns.rs
index fcc361489..fcc361489 100644
--- a/src/test/ui/pattern/bindings-after-at/or-patterns.rs
+++ b/tests/ui/pattern/bindings-after-at/or-patterns.rs
diff --git a/src/test/ui/pattern/bindings-after-at/pat-at-same-name-both.rs b/tests/ui/pattern/bindings-after-at/pat-at-same-name-both.rs
index f167a3952..f167a3952 100644
--- a/src/test/ui/pattern/bindings-after-at/pat-at-same-name-both.rs
+++ b/tests/ui/pattern/bindings-after-at/pat-at-same-name-both.rs
diff --git a/src/test/ui/pattern/bindings-after-at/pat-at-same-name-both.stderr b/tests/ui/pattern/bindings-after-at/pat-at-same-name-both.stderr
index a165549f6..a165549f6 100644
--- a/src/test/ui/pattern/bindings-after-at/pat-at-same-name-both.stderr
+++ b/tests/ui/pattern/bindings-after-at/pat-at-same-name-both.stderr
diff --git a/src/test/ui/pattern/bindings-after-at/slice-patterns.rs b/tests/ui/pattern/bindings-after-at/slice-patterns.rs
index 4f4c96e45..4f4c96e45 100644
--- a/src/test/ui/pattern/bindings-after-at/slice-patterns.rs
+++ b/tests/ui/pattern/bindings-after-at/slice-patterns.rs
diff --git a/src/test/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.rs b/tests/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.rs
index 50ac0ef27..50ac0ef27 100644
--- a/src/test/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.rs
+++ b/tests/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.rs
diff --git a/src/test/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.stderr b/tests/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.stderr
index 2f4541584..2f4541584 100644
--- a/src/test/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.stderr
+++ b/tests/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.stderr
diff --git a/src/test/ui/pattern/for-loop-bad-item.rs b/tests/ui/pattern/for-loop-bad-item.rs
index 9a56a399b..9a56a399b 100644
--- a/src/test/ui/pattern/for-loop-bad-item.rs
+++ b/tests/ui/pattern/for-loop-bad-item.rs
diff --git a/src/test/ui/pattern/for-loop-bad-item.stderr b/tests/ui/pattern/for-loop-bad-item.stderr
index f064a25a9..f064a25a9 100644
--- a/src/test/ui/pattern/for-loop-bad-item.stderr
+++ b/tests/ui/pattern/for-loop-bad-item.stderr
diff --git a/src/test/ui/pattern/ignore-all-the-things.rs b/tests/ui/pattern/ignore-all-the-things.rs
index 5980e1a85..5980e1a85 100644
--- a/src/test/ui/pattern/ignore-all-the-things.rs
+++ b/tests/ui/pattern/ignore-all-the-things.rs
diff --git a/src/test/ui/pattern/integer-range-binding.rs b/tests/ui/pattern/integer-range-binding.rs
index ff065882d..ff065882d 100644
--- a/src/test/ui/pattern/integer-range-binding.rs
+++ b/tests/ui/pattern/integer-range-binding.rs
diff --git a/src/test/ui/pattern/issue-10392.rs b/tests/ui/pattern/issue-10392.rs
index 926fa9480..926fa9480 100644
--- a/src/test/ui/pattern/issue-10392.rs
+++ b/tests/ui/pattern/issue-10392.rs
diff --git a/tests/ui/pattern/issue-106552.rs b/tests/ui/pattern/issue-106552.rs
new file mode 100644
index 000000000..aa2c141e0
--- /dev/null
+++ b/tests/ui/pattern/issue-106552.rs
@@ -0,0 +1,7 @@
+fn main() {
+ let 5 = 6;
+ //~^ error refutable pattern in local binding [E0005]
+
+ let x @ 5 = 6;
+ //~^ error refutable pattern in local binding [E0005]
+}
diff --git a/tests/ui/pattern/issue-106552.stderr b/tests/ui/pattern/issue-106552.stderr
new file mode 100644
index 000000000..ed5d40c09
--- /dev/null
+++ b/tests/ui/pattern/issue-106552.stderr
@@ -0,0 +1,35 @@
+error[E0005]: refutable pattern in local binding
+ --> $DIR/issue-106552.rs:2:9
+ |
+LL | let 5 = 6;
+ | ^ patterns `i32::MIN..=4_i32` and `6_i32..=i32::MAX` not covered
+ |
+ = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
+ = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
+ = note: the matched value is of type `i32`
+help: you might want to use `if let` to ignore the variants that aren't matched
+ |
+LL | if let 5 = 6 { todo!() }
+ | ++ ~~~~~~~~~~~
+help: alternatively, you could prepend the pattern with an underscore to define a new named variable; identifiers cannot begin with digits
+ |
+LL | let _5 = 6;
+ | +
+
+error[E0005]: refutable pattern in local binding
+ --> $DIR/issue-106552.rs:5:9
+ |
+LL | let x @ 5 = 6;
+ | ^^^^^ patterns `i32::MIN..=4_i32` and `6_i32..=i32::MAX` not covered
+ |
+ = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
+ = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
+ = note: the matched value is of type `i32`
+help: you might want to use `let else` to handle the variants that aren't matched
+ |
+LL | let x @ 5 = 6 else { todo!() };
+ | ++++++++++++++++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0005`.
diff --git a/src/test/ui/pattern/issue-11577.rs b/tests/ui/pattern/issue-11577.rs
index 70177c5ed..70177c5ed 100644
--- a/src/test/ui/pattern/issue-11577.rs
+++ b/tests/ui/pattern/issue-11577.rs
diff --git a/src/test/ui/pattern/issue-12582.rs b/tests/ui/pattern/issue-12582.rs
index f3366704e..f3366704e 100644
--- a/src/test/ui/pattern/issue-12582.rs
+++ b/tests/ui/pattern/issue-12582.rs
diff --git a/tests/ui/pattern/issue-14221.rs b/tests/ui/pattern/issue-14221.rs
new file mode 100644
index 000000000..13427d2c9
--- /dev/null
+++ b/tests/ui/pattern/issue-14221.rs
@@ -0,0 +1,21 @@
+#![deny(unreachable_patterns)]
+#![allow(unused_variables)]
+#![allow(non_snake_case)]
+
+pub enum E {
+ A,
+ B,
+}
+
+pub mod b {
+ pub fn key(e: ::E) -> &'static str {
+ match e {
+ A => "A",
+//~^ ERROR pattern binding `A` is named the same as one of the variants of the type `E`
+ B => "B", //~ ERROR: unreachable pattern
+//~^ ERROR pattern binding `B` is named the same as one of the variants of the type `E`
+ }
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/pattern/issue-14221.stderr b/tests/ui/pattern/issue-14221.stderr
new file mode 100644
index 000000000..7ea51b5f8
--- /dev/null
+++ b/tests/ui/pattern/issue-14221.stderr
@@ -0,0 +1,32 @@
+error[E0170]: pattern binding `A` is named the same as one of the variants of the type `E`
+ --> $DIR/issue-14221.rs:13:13
+ |
+LL | A => "A",
+ | ^ help: to match on the variant, qualify the path: `E::A`
+ |
+ = note: `#[deny(bindings_with_variant_name)]` on by default
+
+error[E0170]: pattern binding `B` is named the same as one of the variants of the type `E`
+ --> $DIR/issue-14221.rs:15:13
+ |
+LL | B => "B",
+ | ^ help: to match on the variant, qualify the path: `E::B`
+
+error: unreachable pattern
+ --> $DIR/issue-14221.rs:15:13
+ |
+LL | A => "A",
+ | - matches any value
+LL |
+LL | B => "B",
+ | ^ unreachable pattern
+ |
+note: the lint level is defined here
+ --> $DIR/issue-14221.rs:1:9
+ |
+LL | #![deny(unreachable_patterns)]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0170`.
diff --git a/src/test/ui/pattern/issue-15080.rs b/tests/ui/pattern/issue-15080.rs
index 4dd6981d4..4dd6981d4 100644
--- a/src/test/ui/pattern/issue-15080.rs
+++ b/tests/ui/pattern/issue-15080.rs
diff --git a/src/test/ui/pattern/issue-17718-patterns.rs b/tests/ui/pattern/issue-17718-patterns.rs
index 2ca0f67f8..2ca0f67f8 100644
--- a/src/test/ui/pattern/issue-17718-patterns.rs
+++ b/tests/ui/pattern/issue-17718-patterns.rs
diff --git a/src/test/ui/pattern/issue-17718-patterns.stderr b/tests/ui/pattern/issue-17718-patterns.stderr
index 109091c2a..109091c2a 100644
--- a/src/test/ui/pattern/issue-17718-patterns.stderr
+++ b/tests/ui/pattern/issue-17718-patterns.stderr
diff --git a/src/test/ui/pattern/issue-22546.rs b/tests/ui/pattern/issue-22546.rs
index c26e457f9..c26e457f9 100644
--- a/src/test/ui/pattern/issue-22546.rs
+++ b/tests/ui/pattern/issue-22546.rs
diff --git a/src/test/ui/pattern/issue-27320.rs b/tests/ui/pattern/issue-27320.rs
index d1aa56b91..d1aa56b91 100644
--- a/src/test/ui/pattern/issue-27320.rs
+++ b/tests/ui/pattern/issue-27320.rs
diff --git a/src/test/ui/pattern/issue-52240.rs b/tests/ui/pattern/issue-52240.rs
index 5def55778..5def55778 100644
--- a/src/test/ui/pattern/issue-52240.rs
+++ b/tests/ui/pattern/issue-52240.rs
diff --git a/src/test/ui/pattern/issue-52240.stderr b/tests/ui/pattern/issue-52240.stderr
index 69b663b17..69b663b17 100644
--- a/src/test/ui/pattern/issue-52240.stderr
+++ b/tests/ui/pattern/issue-52240.stderr
diff --git a/src/test/ui/pattern/issue-6449.rs b/tests/ui/pattern/issue-6449.rs
index bfd4c1232..bfd4c1232 100644
--- a/src/test/ui/pattern/issue-6449.rs
+++ b/tests/ui/pattern/issue-6449.rs
diff --git a/src/test/ui/pattern/issue-66270-pat-struct-parser-recovery.rs b/tests/ui/pattern/issue-66270-pat-struct-parser-recovery.rs
index 48a8e0482..48a8e0482 100644
--- a/src/test/ui/pattern/issue-66270-pat-struct-parser-recovery.rs
+++ b/tests/ui/pattern/issue-66270-pat-struct-parser-recovery.rs
diff --git a/src/test/ui/pattern/issue-66270-pat-struct-parser-recovery.stderr b/tests/ui/pattern/issue-66270-pat-struct-parser-recovery.stderr
index f40642f30..f40642f30 100644
--- a/src/test/ui/pattern/issue-66270-pat-struct-parser-recovery.stderr
+++ b/tests/ui/pattern/issue-66270-pat-struct-parser-recovery.stderr
diff --git a/src/test/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.rs b/tests/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.rs
index ae28c1403..ae28c1403 100644
--- a/src/test/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.rs
+++ b/tests/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.rs
diff --git a/src/test/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr b/tests/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr
index 75a231f6b..75a231f6b 100644
--- a/src/test/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr
+++ b/tests/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr
diff --git a/tests/ui/pattern/issue-67776-match-same-name-enum-variant-refs.rs b/tests/ui/pattern/issue-67776-match-same-name-enum-variant-refs.rs
new file mode 100644
index 000000000..05d097eaf
--- /dev/null
+++ b/tests/ui/pattern/issue-67776-match-same-name-enum-variant-refs.rs
@@ -0,0 +1,40 @@
+// Test for issue #67776: binding named the same as enum variant
+// should report an error even when matching against a reference type
+
+#![allow(unused_variables)]
+#![allow(non_snake_case)]
+
+enum Foo {
+ Bar,
+ Baz,
+}
+
+
+fn fn1(e: Foo) {
+ match e {
+ Bar => {},
+ //~^ ERROR named the same as one of the variants of the type `Foo`
+ Baz => {},
+ //~^ ERROR named the same as one of the variants of the type `Foo`
+ }
+}
+
+fn fn2(e: &Foo) {
+ match e {
+ Bar => {},
+ //~^ ERROR named the same as one of the variants of the type `Foo`
+ Baz => {},
+ //~^ ERROR named the same as one of the variants of the type `Foo`
+ }
+}
+
+fn fn3(e: &mut &&mut Foo) {
+ match e {
+ Bar => {},
+ //~^ ERROR named the same as one of the variants of the type `Foo`
+ Baz => {},
+ //~^ ERROR named the same as one of the variants of the type `Foo`
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/pattern/issue-67776-match-same-name-enum-variant-refs.stderr b/tests/ui/pattern/issue-67776-match-same-name-enum-variant-refs.stderr
new file mode 100644
index 000000000..da580c7ac
--- /dev/null
+++ b/tests/ui/pattern/issue-67776-match-same-name-enum-variant-refs.stderr
@@ -0,0 +1,41 @@
+error[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo`
+ --> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:15:9
+ |
+LL | Bar => {},
+ | ^^^ help: to match on the variant, qualify the path: `Foo::Bar`
+ |
+ = note: `#[deny(bindings_with_variant_name)]` on by default
+
+error[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo`
+ --> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:17:9
+ |
+LL | Baz => {},
+ | ^^^ help: to match on the variant, qualify the path: `Foo::Baz`
+
+error[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo`
+ --> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:24:9
+ |
+LL | Bar => {},
+ | ^^^ help: to match on the variant, qualify the path: `Foo::Bar`
+
+error[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo`
+ --> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:26:9
+ |
+LL | Baz => {},
+ | ^^^ help: to match on the variant, qualify the path: `Foo::Baz`
+
+error[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo`
+ --> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:33:9
+ |
+LL | Bar => {},
+ | ^^^ help: to match on the variant, qualify the path: `Foo::Bar`
+
+error[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo`
+ --> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:35:9
+ |
+LL | Baz => {},
+ | ^^^ help: to match on the variant, qualify the path: `Foo::Baz`
+
+error: aborting due to 6 previous errors
+
+For more information about this error, try `rustc --explain E0170`.
diff --git a/src/test/ui/pattern/issue-68393-let-pat-assoc-constant.rs b/tests/ui/pattern/issue-68393-let-pat-assoc-constant.rs
index 95ead6b5d..95ead6b5d 100644
--- a/src/test/ui/pattern/issue-68393-let-pat-assoc-constant.rs
+++ b/tests/ui/pattern/issue-68393-let-pat-assoc-constant.rs
diff --git a/src/test/ui/pattern/issue-68393-let-pat-assoc-constant.stderr b/tests/ui/pattern/issue-68393-let-pat-assoc-constant.stderr
index 54ecc2498..54ecc2498 100644
--- a/src/test/ui/pattern/issue-68393-let-pat-assoc-constant.stderr
+++ b/tests/ui/pattern/issue-68393-let-pat-assoc-constant.stderr
diff --git a/src/test/ui/pattern/issue-72565.rs b/tests/ui/pattern/issue-72565.rs
index 1e262fd50..1e262fd50 100644
--- a/src/test/ui/pattern/issue-72565.rs
+++ b/tests/ui/pattern/issue-72565.rs
diff --git a/src/test/ui/pattern/issue-72565.stderr b/tests/ui/pattern/issue-72565.stderr
index 2f82616b2..2f82616b2 100644
--- a/src/test/ui/pattern/issue-72565.stderr
+++ b/tests/ui/pattern/issue-72565.stderr
diff --git a/src/test/ui/pattern/issue-72574-1.rs b/tests/ui/pattern/issue-72574-1.rs
index 1b80a2179..1b80a2179 100644
--- a/src/test/ui/pattern/issue-72574-1.rs
+++ b/tests/ui/pattern/issue-72574-1.rs
diff --git a/src/test/ui/pattern/issue-72574-1.stderr b/tests/ui/pattern/issue-72574-1.stderr
index 653869a23..653869a23 100644
--- a/src/test/ui/pattern/issue-72574-1.stderr
+++ b/tests/ui/pattern/issue-72574-1.stderr
diff --git a/src/test/ui/pattern/issue-72574-2.rs b/tests/ui/pattern/issue-72574-2.rs
index 0ad2db848..0ad2db848 100644
--- a/src/test/ui/pattern/issue-72574-2.rs
+++ b/tests/ui/pattern/issue-72574-2.rs
diff --git a/src/test/ui/pattern/issue-72574-2.stderr b/tests/ui/pattern/issue-72574-2.stderr
index 05650f05c..05650f05c 100644
--- a/src/test/ui/pattern/issue-72574-2.stderr
+++ b/tests/ui/pattern/issue-72574-2.stderr
diff --git a/src/test/ui/pattern/issue-74539.rs b/tests/ui/pattern/issue-74539.rs
index 0b25f87ec..0b25f87ec 100644
--- a/src/test/ui/pattern/issue-74539.rs
+++ b/tests/ui/pattern/issue-74539.rs
diff --git a/src/test/ui/pattern/issue-74539.stderr b/tests/ui/pattern/issue-74539.stderr
index 7443946c0..7443946c0 100644
--- a/src/test/ui/pattern/issue-74539.stderr
+++ b/tests/ui/pattern/issue-74539.stderr
diff --git a/src/test/ui/pattern/issue-74702.rs b/tests/ui/pattern/issue-74702.rs
index 0aeb3b217..0aeb3b217 100644
--- a/src/test/ui/pattern/issue-74702.rs
+++ b/tests/ui/pattern/issue-74702.rs
diff --git a/src/test/ui/pattern/issue-74702.stderr b/tests/ui/pattern/issue-74702.stderr
index f2e2c8f02..f2e2c8f02 100644
--- a/src/test/ui/pattern/issue-74702.stderr
+++ b/tests/ui/pattern/issue-74702.stderr
diff --git a/src/test/ui/pattern/issue-74954.rs b/tests/ui/pattern/issue-74954.rs
index 269ec3c7a..269ec3c7a 100644
--- a/src/test/ui/pattern/issue-74954.rs
+++ b/tests/ui/pattern/issue-74954.rs
diff --git a/src/test/ui/pattern/issue-80186-mut-binding-help-suggestion.rs b/tests/ui/pattern/issue-80186-mut-binding-help-suggestion.rs
index a5e9b1db5..a5e9b1db5 100644
--- a/src/test/ui/pattern/issue-80186-mut-binding-help-suggestion.rs
+++ b/tests/ui/pattern/issue-80186-mut-binding-help-suggestion.rs
diff --git a/src/test/ui/pattern/issue-80186-mut-binding-help-suggestion.stderr b/tests/ui/pattern/issue-80186-mut-binding-help-suggestion.stderr
index 75b6c163b..75b6c163b 100644
--- a/src/test/ui/pattern/issue-80186-mut-binding-help-suggestion.stderr
+++ b/tests/ui/pattern/issue-80186-mut-binding-help-suggestion.stderr
diff --git a/src/test/ui/pattern/issue-8351-1.rs b/tests/ui/pattern/issue-8351-1.rs
index 139f027cb..139f027cb 100644
--- a/src/test/ui/pattern/issue-8351-1.rs
+++ b/tests/ui/pattern/issue-8351-1.rs
diff --git a/src/test/ui/pattern/issue-8351-2.rs b/tests/ui/pattern/issue-8351-2.rs
index bc66cbb77..bc66cbb77 100644
--- a/src/test/ui/pattern/issue-8351-2.rs
+++ b/tests/ui/pattern/issue-8351-2.rs
diff --git a/src/test/ui/pattern/issue-88074-pat-range-type-inference-err.rs b/tests/ui/pattern/issue-88074-pat-range-type-inference-err.rs
index 16df272df..16df272df 100644
--- a/src/test/ui/pattern/issue-88074-pat-range-type-inference-err.rs
+++ b/tests/ui/pattern/issue-88074-pat-range-type-inference-err.rs
diff --git a/src/test/ui/pattern/issue-88074-pat-range-type-inference-err.stderr b/tests/ui/pattern/issue-88074-pat-range-type-inference-err.stderr
index 8e528f8c1..8e528f8c1 100644
--- a/src/test/ui/pattern/issue-88074-pat-range-type-inference-err.stderr
+++ b/tests/ui/pattern/issue-88074-pat-range-type-inference-err.stderr
diff --git a/src/test/ui/pattern/issue-88074-pat-range-type-inference.rs b/tests/ui/pattern/issue-88074-pat-range-type-inference.rs
index 27db7d8c7..27db7d8c7 100644
--- a/src/test/ui/pattern/issue-88074-pat-range-type-inference.rs
+++ b/tests/ui/pattern/issue-88074-pat-range-type-inference.rs
diff --git a/src/test/ui/pattern/issue-92074-macro-ice.rs b/tests/ui/pattern/issue-92074-macro-ice.rs
index 039d3b314..039d3b314 100644
--- a/src/test/ui/pattern/issue-92074-macro-ice.rs
+++ b/tests/ui/pattern/issue-92074-macro-ice.rs
diff --git a/src/test/ui/pattern/issue-92074-macro-ice.stderr b/tests/ui/pattern/issue-92074-macro-ice.stderr
index b340afff0..b340afff0 100644
--- a/src/test/ui/pattern/issue-92074-macro-ice.stderr
+++ b/tests/ui/pattern/issue-92074-macro-ice.stderr
diff --git a/src/test/ui/pattern/issue-95878.rs b/tests/ui/pattern/issue-95878.rs
index f59814468..f59814468 100644
--- a/src/test/ui/pattern/issue-95878.rs
+++ b/tests/ui/pattern/issue-95878.rs
diff --git a/src/test/ui/pattern/issue-95878.stderr b/tests/ui/pattern/issue-95878.stderr
index e0eea06e0..e0eea06e0 100644
--- a/src/test/ui/pattern/issue-95878.stderr
+++ b/tests/ui/pattern/issue-95878.stderr
diff --git a/src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern-pass.rs b/tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern-pass.rs
index 5445696fd..5445696fd 100644
--- a/src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern-pass.rs
+++ b/tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern-pass.rs
diff --git a/src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.rs b/tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.rs
index a6144c949..a6144c949 100644
--- a/src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.rs
+++ b/tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.rs
diff --git a/src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr b/tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr
index bb7b81836..1b93267b3 100644
--- a/src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr
+++ b/tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr
@@ -104,20 +104,24 @@ LL | *_x0 = U;
error[E0594]: cannot assign to `*_x0`, which is behind a `&` reference
--> $DIR/borrowck-move-ref-pattern.rs:26:5
|
-LL | let (ref _x0, _x1, ref _x2, ..) = tup;
- | ------- help: consider changing this to be a mutable reference: `ref mut _x0`
-...
LL | *_x0 = U;
| ^^^^^^^^ `_x0` is a `&` reference, so the data it refers to cannot be written
+ |
+help: consider changing this to be a mutable reference
+ |
+LL | let (ref mut _x0, _x1, ref _x2, ..) = tup;
+ | ~~~~~~~~~~~
error[E0594]: cannot assign to `*_x2`, which is behind a `&` reference
--> $DIR/borrowck-move-ref-pattern.rs:27:5
|
-LL | let (ref _x0, _x1, ref _x2, ..) = tup;
- | ------- help: consider changing this to be a mutable reference: `ref mut _x2`
-...
LL | *_x2 = U;
| ^^^^^^^^ `_x2` is a `&` reference, so the data it refers to cannot be written
+ |
+help: consider changing this to be a mutable reference
+ |
+LL | let (ref _x0, _x1, ref mut _x2, ..) = tup;
+ | ~~~~~~~~~~~
error[E0382]: use of moved value: `tup.1`
--> $DIR/borrowck-move-ref-pattern.rs:28:10
diff --git a/src/test/ui/pattern/move-ref-patterns/by-move-sub-pat-unreachable.rs b/tests/ui/pattern/move-ref-patterns/by-move-sub-pat-unreachable.rs
index ff7b625a6..ff7b625a6 100644
--- a/src/test/ui/pattern/move-ref-patterns/by-move-sub-pat-unreachable.rs
+++ b/tests/ui/pattern/move-ref-patterns/by-move-sub-pat-unreachable.rs
diff --git a/src/test/ui/pattern/move-ref-patterns/issue-53840.rs b/tests/ui/pattern/move-ref-patterns/issue-53840.rs
index 80effc497..80effc497 100644
--- a/src/test/ui/pattern/move-ref-patterns/issue-53840.rs
+++ b/tests/ui/pattern/move-ref-patterns/issue-53840.rs
diff --git a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.rs b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.rs
index ebb1683af..ebb1683af 100644
--- a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.rs
+++ b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.rs
diff --git a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.stderr b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.stderr
index f19fed089..f19fed089 100644
--- a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.stderr
+++ b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.stderr
diff --git a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-pass.rs b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-pass.rs
index 583f70f41..583f70f41 100644
--- a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-pass.rs
+++ b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-pass.rs
diff --git a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.rs b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.rs
index cd619cc41..cd619cc41 100644
--- a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.rs
+++ b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.rs
diff --git a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr
index eba65a618..eba65a618 100644
--- a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr
+++ b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr
diff --git a/tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes-fixable.fixed b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes-fixable.fixed
new file mode 100644
index 000000000..5f04fc83d
--- /dev/null
+++ b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes-fixable.fixed
@@ -0,0 +1,12 @@
+// run-rustfix
+#![allow(unused_variables)]
+fn main() {
+ struct U;
+
+ // A tuple is a "non-reference pattern".
+ // A `mut` binding pattern resets the binding mode to by-value.
+
+ let mut p = (U, U);
+ let (a, ref mut b) = &mut p;
+ //~^ ERROR cannot move out of a mutable reference
+}
diff --git a/tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes-fixable.rs b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes-fixable.rs
new file mode 100644
index 000000000..5dc1ae2fe
--- /dev/null
+++ b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes-fixable.rs
@@ -0,0 +1,12 @@
+// run-rustfix
+#![allow(unused_variables)]
+fn main() {
+ struct U;
+
+ // A tuple is a "non-reference pattern".
+ // A `mut` binding pattern resets the binding mode to by-value.
+
+ let mut p = (U, U);
+ let (a, mut b) = &mut p;
+ //~^ ERROR cannot move out of a mutable reference
+}
diff --git a/tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes-fixable.stderr b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes-fixable.stderr
new file mode 100644
index 000000000..d3ab533e3
--- /dev/null
+++ b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes-fixable.stderr
@@ -0,0 +1,17 @@
+error[E0507]: cannot move out of a mutable reference
+ --> $DIR/move-ref-patterns-default-binding-modes-fixable.rs:10:22
+ |
+LL | let (a, mut b) = &mut p;
+ | ----- ^^^^^^
+ | |
+ | data moved here
+ | move occurs because `b` has type `U`, which does not implement the `Copy` trait
+ |
+help: consider borrowing the pattern binding
+ |
+LL | let (a, ref mut b) = &mut p;
+ | +++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0507`.
diff --git a/tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes.rs b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes.rs
new file mode 100644
index 000000000..6c913c245
--- /dev/null
+++ b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes.rs
@@ -0,0 +1,10 @@
+fn main() {
+ struct U;
+
+ // A tuple is a "non-reference pattern".
+ // A `mut` binding pattern resets the binding mode to by-value.
+
+ let p = (U, U);
+ let (a, mut b) = &p;
+ //~^ ERROR cannot move out of a shared reference
+}
diff --git a/tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes.stderr b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes.stderr
new file mode 100644
index 000000000..65030b622
--- /dev/null
+++ b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes.stderr
@@ -0,0 +1,17 @@
+error[E0507]: cannot move out of a shared reference
+ --> $DIR/move-ref-patterns-default-binding-modes.rs:8:22
+ |
+LL | let (a, mut b) = &p;
+ | ----- ^^
+ | |
+ | data moved here
+ | move occurs because `b` has type `U`, which does not implement the `Copy` trait
+ |
+help: consider borrowing the pattern binding
+ |
+LL | let (a, ref mut b) = &p;
+ | +++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0507`.
diff --git a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-dynamic-semantics.rs b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-dynamic-semantics.rs
index 1d6d9acea..1d6d9acea 100644
--- a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-dynamic-semantics.rs
+++ b/tests/ui/pattern/move-ref-patterns/move-ref-patterns-dynamic-semantics.rs
diff --git a/src/test/ui/pattern/non-constant-in-const-path.rs b/tests/ui/pattern/non-constant-in-const-path.rs
index 3918485ba..3918485ba 100644
--- a/src/test/ui/pattern/non-constant-in-const-path.rs
+++ b/tests/ui/pattern/non-constant-in-const-path.rs
diff --git a/src/test/ui/pattern/non-constant-in-const-path.stderr b/tests/ui/pattern/non-constant-in-const-path.stderr
index 53c3974f7..53c3974f7 100644
--- a/src/test/ui/pattern/non-constant-in-const-path.stderr
+++ b/tests/ui/pattern/non-constant-in-const-path.stderr
diff --git a/src/test/ui/pattern/non-structural-match-types.rs b/tests/ui/pattern/non-structural-match-types.rs
index 5c3315473..5c3315473 100644
--- a/src/test/ui/pattern/non-structural-match-types.rs
+++ b/tests/ui/pattern/non-structural-match-types.rs
diff --git a/src/test/ui/pattern/non-structural-match-types.stderr b/tests/ui/pattern/non-structural-match-types.stderr
index dea7c4695..dea7c4695 100644
--- a/src/test/ui/pattern/non-structural-match-types.stderr
+++ b/tests/ui/pattern/non-structural-match-types.stderr
diff --git a/src/test/ui/pattern/pat-shadow-in-nested-binding.rs b/tests/ui/pattern/pat-shadow-in-nested-binding.rs
index 7badbb6b9..7badbb6b9 100644
--- a/src/test/ui/pattern/pat-shadow-in-nested-binding.rs
+++ b/tests/ui/pattern/pat-shadow-in-nested-binding.rs
diff --git a/src/test/ui/pattern/pat-shadow-in-nested-binding.stderr b/tests/ui/pattern/pat-shadow-in-nested-binding.stderr
index 0c5824be9..0c5824be9 100644
--- a/src/test/ui/pattern/pat-shadow-in-nested-binding.stderr
+++ b/tests/ui/pattern/pat-shadow-in-nested-binding.stderr
diff --git a/src/test/ui/pattern/pat-struct-field-expr-has-type.rs b/tests/ui/pattern/pat-struct-field-expr-has-type.rs
index 1d18214de..1d18214de 100644
--- a/src/test/ui/pattern/pat-struct-field-expr-has-type.rs
+++ b/tests/ui/pattern/pat-struct-field-expr-has-type.rs
diff --git a/src/test/ui/pattern/pat-struct-field-expr-has-type.stderr b/tests/ui/pattern/pat-struct-field-expr-has-type.stderr
index 3a61d4293..3a61d4293 100644
--- a/src/test/ui/pattern/pat-struct-field-expr-has-type.stderr
+++ b/tests/ui/pattern/pat-struct-field-expr-has-type.stderr
diff --git a/src/test/ui/pattern/pat-tuple-bad-type.rs b/tests/ui/pattern/pat-tuple-bad-type.rs
index 98481167a..98481167a 100644
--- a/src/test/ui/pattern/pat-tuple-bad-type.rs
+++ b/tests/ui/pattern/pat-tuple-bad-type.rs
diff --git a/src/test/ui/pattern/pat-tuple-bad-type.stderr b/tests/ui/pattern/pat-tuple-bad-type.stderr
index 3342b8e40..da369d333 100644
--- a/src/test/ui/pattern/pat-tuple-bad-type.stderr
+++ b/tests/ui/pattern/pat-tuple-bad-type.stderr
@@ -9,8 +9,8 @@ LL | (..) => {}
|
help: consider giving `x` an explicit type
|
-LL | let x: _;
- | +++
+LL | let x: /* Type */;
+ | ++++++++++++
error[E0308]: mismatched types
--> $DIR/pat-tuple-bad-type.rs:10:9
diff --git a/src/test/ui/pattern/pat-tuple-field-count-cross.rs b/tests/ui/pattern/pat-tuple-field-count-cross.rs
index b63da4e15..b63da4e15 100644
--- a/src/test/ui/pattern/pat-tuple-field-count-cross.rs
+++ b/tests/ui/pattern/pat-tuple-field-count-cross.rs
diff --git a/src/test/ui/pattern/pat-tuple-field-count-cross.stderr b/tests/ui/pattern/pat-tuple-field-count-cross.stderr
index d92957461..d92957461 100644
--- a/src/test/ui/pattern/pat-tuple-field-count-cross.stderr
+++ b/tests/ui/pattern/pat-tuple-field-count-cross.stderr
diff --git a/src/test/ui/pattern/pat-tuple-overfield.rs b/tests/ui/pattern/pat-tuple-overfield.rs
index c863c6575..c863c6575 100644
--- a/src/test/ui/pattern/pat-tuple-overfield.rs
+++ b/tests/ui/pattern/pat-tuple-overfield.rs
diff --git a/src/test/ui/pattern/pat-tuple-overfield.stderr b/tests/ui/pattern/pat-tuple-overfield.stderr
index 54d89e031..54d89e031 100644
--- a/src/test/ui/pattern/pat-tuple-overfield.stderr
+++ b/tests/ui/pattern/pat-tuple-overfield.stderr
diff --git a/src/test/ui/pattern/pat-tuple-underfield.rs b/tests/ui/pattern/pat-tuple-underfield.rs
index dac60e3fa..dac60e3fa 100644
--- a/src/test/ui/pattern/pat-tuple-underfield.rs
+++ b/tests/ui/pattern/pat-tuple-underfield.rs
diff --git a/src/test/ui/pattern/pat-tuple-underfield.stderr b/tests/ui/pattern/pat-tuple-underfield.stderr
index e75f9b38d..e75f9b38d 100644
--- a/src/test/ui/pattern/pat-tuple-underfield.stderr
+++ b/tests/ui/pattern/pat-tuple-underfield.stderr
diff --git a/src/test/ui/pattern/pat-type-err-formal-param.rs b/tests/ui/pattern/pat-type-err-formal-param.rs
index 54336b349..54336b349 100644
--- a/src/test/ui/pattern/pat-type-err-formal-param.rs
+++ b/tests/ui/pattern/pat-type-err-formal-param.rs
diff --git a/src/test/ui/pattern/pat-type-err-formal-param.stderr b/tests/ui/pattern/pat-type-err-formal-param.stderr
index 206713a4b..206713a4b 100644
--- a/src/test/ui/pattern/pat-type-err-formal-param.stderr
+++ b/tests/ui/pattern/pat-type-err-formal-param.stderr
diff --git a/src/test/ui/pattern/pat-type-err-let-stmt.rs b/tests/ui/pattern/pat-type-err-let-stmt.rs
index 6e9850b65..6e9850b65 100644
--- a/src/test/ui/pattern/pat-type-err-let-stmt.rs
+++ b/tests/ui/pattern/pat-type-err-let-stmt.rs
diff --git a/src/test/ui/pattern/pat-type-err-let-stmt.stderr b/tests/ui/pattern/pat-type-err-let-stmt.stderr
index 090bd6711..090bd6711 100644
--- a/src/test/ui/pattern/pat-type-err-let-stmt.stderr
+++ b/tests/ui/pattern/pat-type-err-let-stmt.stderr
diff --git a/src/test/ui/pattern/patkind-litrange-no-expr.rs b/tests/ui/pattern/patkind-litrange-no-expr.rs
index 7ef541cb5..7ef541cb5 100644
--- a/src/test/ui/pattern/patkind-litrange-no-expr.rs
+++ b/tests/ui/pattern/patkind-litrange-no-expr.rs
diff --git a/src/test/ui/pattern/patkind-litrange-no-expr.stderr b/tests/ui/pattern/patkind-litrange-no-expr.stderr
index eb1ee7e45..eb1ee7e45 100644
--- a/src/test/ui/pattern/patkind-litrange-no-expr.stderr
+++ b/tests/ui/pattern/patkind-litrange-no-expr.stderr
diff --git a/src/test/ui/pattern/pattern-binding-disambiguation.rs b/tests/ui/pattern/pattern-binding-disambiguation.rs
index ce1d8c6c0..ce1d8c6c0 100644
--- a/src/test/ui/pattern/pattern-binding-disambiguation.rs
+++ b/tests/ui/pattern/pattern-binding-disambiguation.rs
diff --git a/src/test/ui/pattern/pattern-binding-disambiguation.stderr b/tests/ui/pattern/pattern-binding-disambiguation.stderr
index d54467b3c..d54467b3c 100644
--- a/src/test/ui/pattern/pattern-binding-disambiguation.stderr
+++ b/tests/ui/pattern/pattern-binding-disambiguation.stderr
diff --git a/src/test/ui/pattern/pattern-error-continue.rs b/tests/ui/pattern/pattern-error-continue.rs
index 0702a9986..0702a9986 100644
--- a/src/test/ui/pattern/pattern-error-continue.rs
+++ b/tests/ui/pattern/pattern-error-continue.rs
diff --git a/src/test/ui/pattern/pattern-error-continue.stderr b/tests/ui/pattern/pattern-error-continue.stderr
index 4c2eff63a..4c2eff63a 100644
--- a/src/test/ui/pattern/pattern-error-continue.stderr
+++ b/tests/ui/pattern/pattern-error-continue.stderr
diff --git a/src/test/ui/pattern/pattern-ident-path-generics.rs b/tests/ui/pattern/pattern-ident-path-generics.rs
index 48c02623f..48c02623f 100644
--- a/src/test/ui/pattern/pattern-ident-path-generics.rs
+++ b/tests/ui/pattern/pattern-ident-path-generics.rs
diff --git a/src/test/ui/pattern/pattern-ident-path-generics.stderr b/tests/ui/pattern/pattern-ident-path-generics.stderr
index 01b082bd3..01b082bd3 100644
--- a/src/test/ui/pattern/pattern-ident-path-generics.stderr
+++ b/tests/ui/pattern/pattern-ident-path-generics.stderr
diff --git a/src/test/ui/pattern/pattern-tyvar-2.rs b/tests/ui/pattern/pattern-tyvar-2.rs
index 7647c766e..7647c766e 100644
--- a/src/test/ui/pattern/pattern-tyvar-2.rs
+++ b/tests/ui/pattern/pattern-tyvar-2.rs
diff --git a/src/test/ui/pattern/pattern-tyvar-2.stderr b/tests/ui/pattern/pattern-tyvar-2.stderr
index 121817e70..121817e70 100644
--- a/src/test/ui/pattern/pattern-tyvar-2.stderr
+++ b/tests/ui/pattern/pattern-tyvar-2.stderr
diff --git a/src/test/ui/pattern/pattern-tyvar.rs b/tests/ui/pattern/pattern-tyvar.rs
index e2cbf0519..e2cbf0519 100644
--- a/src/test/ui/pattern/pattern-tyvar.rs
+++ b/tests/ui/pattern/pattern-tyvar.rs
diff --git a/src/test/ui/pattern/pattern-tyvar.stderr b/tests/ui/pattern/pattern-tyvar.stderr
index f1e2a9d72..f1e2a9d72 100644
--- a/src/test/ui/pattern/pattern-tyvar.stderr
+++ b/tests/ui/pattern/pattern-tyvar.stderr
diff --git a/src/test/ui/pattern/rest-pat-semantic-disallowed.rs b/tests/ui/pattern/rest-pat-semantic-disallowed.rs
index 156285e0f..156285e0f 100644
--- a/src/test/ui/pattern/rest-pat-semantic-disallowed.rs
+++ b/tests/ui/pattern/rest-pat-semantic-disallowed.rs
diff --git a/src/test/ui/pattern/rest-pat-semantic-disallowed.stderr b/tests/ui/pattern/rest-pat-semantic-disallowed.stderr
index e6a4e5f19..beba7def9 100644
--- a/src/test/ui/pattern/rest-pat-semantic-disallowed.stderr
+++ b/tests/ui/pattern/rest-pat-semantic-disallowed.stderr
@@ -193,8 +193,8 @@ LL | let x @ ..;
|
help: consider giving this pattern a type
|
-LL | let x @ ..: _;
- | +++
+LL | let x @ ..: /* Type */;
+ | ++++++++++++
error: aborting due to 23 previous errors
diff --git a/src/test/ui/pattern/rest-pat-syntactic.rs b/tests/ui/pattern/rest-pat-syntactic.rs
index 4da5a2db7..4da5a2db7 100644
--- a/src/test/ui/pattern/rest-pat-syntactic.rs
+++ b/tests/ui/pattern/rest-pat-syntactic.rs
diff --git a/src/test/ui/pattern/rest-pat-syntactic.stderr b/tests/ui/pattern/rest-pat-syntactic.stderr
index 37019b7d5..37019b7d5 100644
--- a/src/test/ui/pattern/rest-pat-syntactic.stderr
+++ b/tests/ui/pattern/rest-pat-syntactic.stderr
diff --git a/src/test/ui/pattern/size-and-align.rs b/tests/ui/pattern/size-and-align.rs
index a32b5de72..a32b5de72 100644
--- a/src/test/ui/pattern/size-and-align.rs
+++ b/tests/ui/pattern/size-and-align.rs
diff --git a/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.fixed b/tests/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.fixed
index b28dce881..b28dce881 100644
--- a/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.fixed
+++ b/tests/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.fixed
diff --git a/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.rs b/tests/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.rs
index 42493a632..42493a632 100644
--- a/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.rs
+++ b/tests/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.rs
diff --git a/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr b/tests/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr
index f3dca9bcb..2a016048f 100644
--- a/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr
+++ b/tests/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr
@@ -6,12 +6,9 @@ LL | match Some(1) {
|
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
+ ::: $SRC_DIR/core/src/option.rs:LL:COL
|
-LL | pub enum Option<T> {
- | ------------------
-...
-LL | None,
- | ^^^^ not covered
+ = note: not covered
= note: the matched value is of type `Option<i32>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
diff --git a/src/test/ui/pattern/usefulness/always-inhabited-union-ref.rs b/tests/ui/pattern/usefulness/always-inhabited-union-ref.rs
index 7d1cac8a4..7d1cac8a4 100644
--- a/src/test/ui/pattern/usefulness/always-inhabited-union-ref.rs
+++ b/tests/ui/pattern/usefulness/always-inhabited-union-ref.rs
diff --git a/src/test/ui/pattern/usefulness/always-inhabited-union-ref.stderr b/tests/ui/pattern/usefulness/always-inhabited-union-ref.stderr
index cd5c283f9..cd5c283f9 100644
--- a/src/test/ui/pattern/usefulness/always-inhabited-union-ref.stderr
+++ b/tests/ui/pattern/usefulness/always-inhabited-union-ref.stderr
diff --git a/src/test/ui/pattern/usefulness/auxiliary/empty.rs b/tests/ui/pattern/usefulness/auxiliary/empty.rs
index 29a03c9e8..29a03c9e8 100644
--- a/src/test/ui/pattern/usefulness/auxiliary/empty.rs
+++ b/tests/ui/pattern/usefulness/auxiliary/empty.rs
diff --git a/src/test/ui/pattern/usefulness/auxiliary/hidden.rs b/tests/ui/pattern/usefulness/auxiliary/hidden.rs
index 364514ba1..364514ba1 100644
--- a/src/test/ui/pattern/usefulness/auxiliary/hidden.rs
+++ b/tests/ui/pattern/usefulness/auxiliary/hidden.rs
diff --git a/src/test/ui/pattern/usefulness/auxiliary/unstable.rs b/tests/ui/pattern/usefulness/auxiliary/unstable.rs
index a06b3a6e4..a06b3a6e4 100644
--- a/src/test/ui/pattern/usefulness/auxiliary/unstable.rs
+++ b/tests/ui/pattern/usefulness/auxiliary/unstable.rs
diff --git a/src/test/ui/pattern/usefulness/const-partial_eq-fallback-ice.rs b/tests/ui/pattern/usefulness/const-partial_eq-fallback-ice.rs
index 02599d7c0..02599d7c0 100644
--- a/src/test/ui/pattern/usefulness/const-partial_eq-fallback-ice.rs
+++ b/tests/ui/pattern/usefulness/const-partial_eq-fallback-ice.rs
diff --git a/src/test/ui/pattern/usefulness/const-partial_eq-fallback-ice.stderr b/tests/ui/pattern/usefulness/const-partial_eq-fallback-ice.stderr
index 358421cd6..358421cd6 100644
--- a/src/test/ui/pattern/usefulness/const-partial_eq-fallback-ice.stderr
+++ b/tests/ui/pattern/usefulness/const-partial_eq-fallback-ice.stderr
diff --git a/src/test/ui/pattern/usefulness/const-pat-ice.rs b/tests/ui/pattern/usefulness/const-pat-ice.rs
index abfacf393..abfacf393 100644
--- a/src/test/ui/pattern/usefulness/const-pat-ice.rs
+++ b/tests/ui/pattern/usefulness/const-pat-ice.rs
diff --git a/src/test/ui/pattern/usefulness/const-private-fields.rs b/tests/ui/pattern/usefulness/const-private-fields.rs
index 06c832ca4..06c832ca4 100644
--- a/src/test/ui/pattern/usefulness/const-private-fields.rs
+++ b/tests/ui/pattern/usefulness/const-private-fields.rs
diff --git a/src/test/ui/pattern/usefulness/consts-opaque.rs b/tests/ui/pattern/usefulness/consts-opaque.rs
index ca4fcd85b..ca4fcd85b 100644
--- a/src/test/ui/pattern/usefulness/consts-opaque.rs
+++ b/tests/ui/pattern/usefulness/consts-opaque.rs
diff --git a/src/test/ui/pattern/usefulness/consts-opaque.stderr b/tests/ui/pattern/usefulness/consts-opaque.stderr
index 35396751a..35396751a 100644
--- a/src/test/ui/pattern/usefulness/consts-opaque.stderr
+++ b/tests/ui/pattern/usefulness/consts-opaque.stderr
diff --git a/src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.rs b/tests/ui/pattern/usefulness/deny-irrefutable-let-patterns.rs
index c85af7f3b..c85af7f3b 100644
--- a/src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.rs
+++ b/tests/ui/pattern/usefulness/deny-irrefutable-let-patterns.rs
diff --git a/src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.stderr b/tests/ui/pattern/usefulness/deny-irrefutable-let-patterns.stderr
index cdb6b5c7a..cdb6b5c7a 100644
--- a/src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.stderr
+++ b/tests/ui/pattern/usefulness/deny-irrefutable-let-patterns.stderr
diff --git a/src/test/ui/pattern/usefulness/doc-hidden-fields.rs b/tests/ui/pattern/usefulness/doc-hidden-fields.rs
index 4163b87dc..4163b87dc 100644
--- a/src/test/ui/pattern/usefulness/doc-hidden-fields.rs
+++ b/tests/ui/pattern/usefulness/doc-hidden-fields.rs
diff --git a/src/test/ui/pattern/usefulness/doc-hidden-fields.stderr b/tests/ui/pattern/usefulness/doc-hidden-fields.stderr
index f277bfbc8..f277bfbc8 100644
--- a/src/test/ui/pattern/usefulness/doc-hidden-fields.stderr
+++ b/tests/ui/pattern/usefulness/doc-hidden-fields.stderr
diff --git a/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.rs b/tests/ui/pattern/usefulness/doc-hidden-non-exhaustive.rs
index 5d4181a30..5d4181a30 100644
--- a/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.rs
+++ b/tests/ui/pattern/usefulness/doc-hidden-non-exhaustive.rs
diff --git a/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr b/tests/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr
index b450a9aed..17e1a2304 100644
--- a/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr
+++ b/tests/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr
@@ -66,12 +66,9 @@ LL | match None {
|
note: `Option<HiddenEnum>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
+ ::: $SRC_DIR/core/src/option.rs:LL:COL
|
-LL | pub enum Option<T> {
- | ------------------
-...
-LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
- | ^^^^ not covered
+ = note: not covered
= note: the matched value is of type `Option<HiddenEnum>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
diff --git a/src/test/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr
index 5e12bc1d2..5e12bc1d2 100644
--- a/src/test/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr
+++ b/tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr
diff --git a/src/test/ui/pattern/usefulness/empty-match.normal.stderr b/tests/ui/pattern/usefulness/empty-match.normal.stderr
index 5e12bc1d2..5e12bc1d2 100644
--- a/src/test/ui/pattern/usefulness/empty-match.normal.stderr
+++ b/tests/ui/pattern/usefulness/empty-match.normal.stderr
diff --git a/src/test/ui/pattern/usefulness/empty-match.rs b/tests/ui/pattern/usefulness/empty-match.rs
index 9cdc0413b..9cdc0413b 100644
--- a/src/test/ui/pattern/usefulness/empty-match.rs
+++ b/tests/ui/pattern/usefulness/empty-match.rs
diff --git a/src/test/ui/pattern/usefulness/floats.rs b/tests/ui/pattern/usefulness/floats.rs
index 095f5ac9a..095f5ac9a 100644
--- a/src/test/ui/pattern/usefulness/floats.rs
+++ b/tests/ui/pattern/usefulness/floats.rs
diff --git a/src/test/ui/pattern/usefulness/floats.stderr b/tests/ui/pattern/usefulness/floats.stderr
index c926e50b3..c926e50b3 100644
--- a/src/test/ui/pattern/usefulness/floats.stderr
+++ b/tests/ui/pattern/usefulness/floats.stderr
diff --git a/src/test/ui/pattern/usefulness/guards.rs b/tests/ui/pattern/usefulness/guards.rs
index b15440cf6..b15440cf6 100644
--- a/src/test/ui/pattern/usefulness/guards.rs
+++ b/tests/ui/pattern/usefulness/guards.rs
diff --git a/src/test/ui/pattern/usefulness/guards.stderr b/tests/ui/pattern/usefulness/guards.stderr
index 0c1563c16..0c1563c16 100644
--- a/src/test/ui/pattern/usefulness/guards.stderr
+++ b/tests/ui/pattern/usefulness/guards.stderr
diff --git a/src/test/ui/pattern/usefulness/integer-ranges/exhaustiveness.rs b/tests/ui/pattern/usefulness/integer-ranges/exhaustiveness.rs
index 0f5f49c4c..0f5f49c4c 100644
--- a/src/test/ui/pattern/usefulness/integer-ranges/exhaustiveness.rs
+++ b/tests/ui/pattern/usefulness/integer-ranges/exhaustiveness.rs
diff --git a/src/test/ui/pattern/usefulness/integer-ranges/exhaustiveness.stderr b/tests/ui/pattern/usefulness/integer-ranges/exhaustiveness.stderr
index f30ba05df..f30ba05df 100644
--- a/src/test/ui/pattern/usefulness/integer-ranges/exhaustiveness.stderr
+++ b/tests/ui/pattern/usefulness/integer-ranges/exhaustiveness.stderr
diff --git a/src/test/ui/pattern/usefulness/integer-ranges/overlapping_range_endpoints.rs b/tests/ui/pattern/usefulness/integer-ranges/overlapping_range_endpoints.rs
index 5ea92b070..5ea92b070 100644
--- a/src/test/ui/pattern/usefulness/integer-ranges/overlapping_range_endpoints.rs
+++ b/tests/ui/pattern/usefulness/integer-ranges/overlapping_range_endpoints.rs
diff --git a/src/test/ui/pattern/usefulness/integer-ranges/overlapping_range_endpoints.stderr b/tests/ui/pattern/usefulness/integer-ranges/overlapping_range_endpoints.stderr
index ea0e8f6e4..ea0e8f6e4 100644
--- a/src/test/ui/pattern/usefulness/integer-ranges/overlapping_range_endpoints.stderr
+++ b/tests/ui/pattern/usefulness/integer-ranges/overlapping_range_endpoints.stderr
diff --git a/src/test/ui/pattern/usefulness/integer-ranges/pointer-sized-int.allow.stderr b/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.allow.stderr
index 9f277fa1e..9f277fa1e 100644
--- a/src/test/ui/pattern/usefulness/integer-ranges/pointer-sized-int.allow.stderr
+++ b/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.allow.stderr
diff --git a/src/test/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr b/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr
index e3eb98ccd..e3eb98ccd 100644
--- a/src/test/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr
+++ b/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr
diff --git a/src/test/ui/pattern/usefulness/integer-ranges/pointer-sized-int.rs b/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.rs
index 1ed18c267..1ed18c267 100644
--- a/src/test/ui/pattern/usefulness/integer-ranges/pointer-sized-int.rs
+++ b/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.rs
diff --git a/src/test/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.rs b/tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.rs
index a2aa655ca..a2aa655ca 100644
--- a/src/test/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.rs
+++ b/tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.rs
diff --git a/src/test/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.stderr b/tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.stderr
index 30492c982..30492c982 100644
--- a/src/test/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.stderr
+++ b/tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.stderr
diff --git a/src/test/ui/pattern/usefulness/integer-ranges/reachability.rs b/tests/ui/pattern/usefulness/integer-ranges/reachability.rs
index fb4d59b05..fb4d59b05 100644
--- a/src/test/ui/pattern/usefulness/integer-ranges/reachability.rs
+++ b/tests/ui/pattern/usefulness/integer-ranges/reachability.rs
diff --git a/src/test/ui/pattern/usefulness/integer-ranges/reachability.stderr b/tests/ui/pattern/usefulness/integer-ranges/reachability.stderr
index 0ffb0ffd8..0ffb0ffd8 100644
--- a/src/test/ui/pattern/usefulness/integer-ranges/reachability.stderr
+++ b/tests/ui/pattern/usefulness/integer-ranges/reachability.stderr
diff --git a/src/test/ui/pattern/usefulness/irrefutable-let-patterns.rs b/tests/ui/pattern/usefulness/irrefutable-let-patterns.rs
index d400ef0bb..d400ef0bb 100644
--- a/src/test/ui/pattern/usefulness/irrefutable-let-patterns.rs
+++ b/tests/ui/pattern/usefulness/irrefutable-let-patterns.rs
diff --git a/src/test/ui/pattern/usefulness/irrefutable-unit.rs b/tests/ui/pattern/usefulness/irrefutable-unit.rs
index dd8f03b6d..dd8f03b6d 100644
--- a/src/test/ui/pattern/usefulness/irrefutable-unit.rs
+++ b/tests/ui/pattern/usefulness/irrefutable-unit.rs
diff --git a/src/test/ui/pattern/usefulness/issue-12116.rs b/tests/ui/pattern/usefulness/issue-12116.rs
index 3cb92a540..3cb92a540 100644
--- a/src/test/ui/pattern/usefulness/issue-12116.rs
+++ b/tests/ui/pattern/usefulness/issue-12116.rs
diff --git a/src/test/ui/pattern/usefulness/issue-12116.stderr b/tests/ui/pattern/usefulness/issue-12116.stderr
index 7f15c4703..7f15c4703 100644
--- a/src/test/ui/pattern/usefulness/issue-12116.stderr
+++ b/tests/ui/pattern/usefulness/issue-12116.stderr
diff --git a/src/test/ui/pattern/usefulness/issue-12369.rs b/tests/ui/pattern/usefulness/issue-12369.rs
index 0481c1fd9..0481c1fd9 100644
--- a/src/test/ui/pattern/usefulness/issue-12369.rs
+++ b/tests/ui/pattern/usefulness/issue-12369.rs
diff --git a/src/test/ui/pattern/usefulness/issue-12369.stderr b/tests/ui/pattern/usefulness/issue-12369.stderr
index aab2be78c..aab2be78c 100644
--- a/src/test/ui/pattern/usefulness/issue-12369.stderr
+++ b/tests/ui/pattern/usefulness/issue-12369.stderr
diff --git a/src/test/ui/pattern/usefulness/issue-13727.rs b/tests/ui/pattern/usefulness/issue-13727.rs
index 7fb565ef3..7fb565ef3 100644
--- a/src/test/ui/pattern/usefulness/issue-13727.rs
+++ b/tests/ui/pattern/usefulness/issue-13727.rs
diff --git a/src/test/ui/pattern/usefulness/issue-13727.stderr b/tests/ui/pattern/usefulness/issue-13727.stderr
index 07ca56a56..07ca56a56 100644
--- a/src/test/ui/pattern/usefulness/issue-13727.stderr
+++ b/tests/ui/pattern/usefulness/issue-13727.stderr
diff --git a/src/test/ui/pattern/usefulness/issue-15129.rs b/tests/ui/pattern/usefulness/issue-15129.rs
index f02e5c0c6..f02e5c0c6 100644
--- a/src/test/ui/pattern/usefulness/issue-15129.rs
+++ b/tests/ui/pattern/usefulness/issue-15129.rs
diff --git a/src/test/ui/pattern/usefulness/issue-15129.stderr b/tests/ui/pattern/usefulness/issue-15129.stderr
index ee8410b76..ee8410b76 100644
--- a/src/test/ui/pattern/usefulness/issue-15129.stderr
+++ b/tests/ui/pattern/usefulness/issue-15129.stderr
diff --git a/src/test/ui/pattern/usefulness/issue-2111.rs b/tests/ui/pattern/usefulness/issue-2111.rs
index d27beaeff..d27beaeff 100644
--- a/src/test/ui/pattern/usefulness/issue-2111.rs
+++ b/tests/ui/pattern/usefulness/issue-2111.rs
diff --git a/src/test/ui/pattern/usefulness/issue-2111.stderr b/tests/ui/pattern/usefulness/issue-2111.stderr
index 01890b73c..01890b73c 100644
--- a/src/test/ui/pattern/usefulness/issue-2111.stderr
+++ b/tests/ui/pattern/usefulness/issue-2111.stderr
diff --git a/src/test/ui/pattern/usefulness/issue-30240-b.rs b/tests/ui/pattern/usefulness/issue-30240-b.rs
index 01a6e7d8c..01a6e7d8c 100644
--- a/src/test/ui/pattern/usefulness/issue-30240-b.rs
+++ b/tests/ui/pattern/usefulness/issue-30240-b.rs
diff --git a/src/test/ui/pattern/usefulness/issue-30240-b.stderr b/tests/ui/pattern/usefulness/issue-30240-b.stderr
index 59d64bc25..59d64bc25 100644
--- a/src/test/ui/pattern/usefulness/issue-30240-b.stderr
+++ b/tests/ui/pattern/usefulness/issue-30240-b.stderr
diff --git a/src/test/ui/pattern/usefulness/issue-30240-rpass.rs b/tests/ui/pattern/usefulness/issue-30240-rpass.rs
index ab16614fd..ab16614fd 100644
--- a/src/test/ui/pattern/usefulness/issue-30240-rpass.rs
+++ b/tests/ui/pattern/usefulness/issue-30240-rpass.rs
diff --git a/src/test/ui/pattern/usefulness/issue-30240.rs b/tests/ui/pattern/usefulness/issue-30240.rs
index a0c0d1626..a0c0d1626 100644
--- a/src/test/ui/pattern/usefulness/issue-30240.rs
+++ b/tests/ui/pattern/usefulness/issue-30240.rs
diff --git a/src/test/ui/pattern/usefulness/issue-30240.stderr b/tests/ui/pattern/usefulness/issue-30240.stderr
index 759fdeafe..759fdeafe 100644
--- a/src/test/ui/pattern/usefulness/issue-30240.stderr
+++ b/tests/ui/pattern/usefulness/issue-30240.stderr
diff --git a/src/test/ui/pattern/usefulness/issue-3096-1.rs b/tests/ui/pattern/usefulness/issue-3096-1.rs
index edc3b3223..edc3b3223 100644
--- a/src/test/ui/pattern/usefulness/issue-3096-1.rs
+++ b/tests/ui/pattern/usefulness/issue-3096-1.rs
diff --git a/src/test/ui/pattern/usefulness/issue-3096-1.stderr b/tests/ui/pattern/usefulness/issue-3096-1.stderr
index d8884394f..d8884394f 100644
--- a/src/test/ui/pattern/usefulness/issue-3096-1.stderr
+++ b/tests/ui/pattern/usefulness/issue-3096-1.stderr
diff --git a/src/test/ui/pattern/usefulness/issue-3096-2.rs b/tests/ui/pattern/usefulness/issue-3096-2.rs
index a26e42580..a26e42580 100644
--- a/src/test/ui/pattern/usefulness/issue-3096-2.rs
+++ b/tests/ui/pattern/usefulness/issue-3096-2.rs
diff --git a/src/test/ui/pattern/usefulness/issue-3096-2.stderr b/tests/ui/pattern/usefulness/issue-3096-2.stderr
index 2df8911ba..2df8911ba 100644
--- a/src/test/ui/pattern/usefulness/issue-3096-2.stderr
+++ b/tests/ui/pattern/usefulness/issue-3096-2.stderr
diff --git a/src/test/ui/pattern/usefulness/issue-31221.rs b/tests/ui/pattern/usefulness/issue-31221.rs
index e03f1ec5b..e03f1ec5b 100644
--- a/src/test/ui/pattern/usefulness/issue-31221.rs
+++ b/tests/ui/pattern/usefulness/issue-31221.rs
diff --git a/src/test/ui/pattern/usefulness/issue-31221.stderr b/tests/ui/pattern/usefulness/issue-31221.stderr
index 7d3491444..7d3491444 100644
--- a/src/test/ui/pattern/usefulness/issue-31221.stderr
+++ b/tests/ui/pattern/usefulness/issue-31221.stderr
diff --git a/tests/ui/pattern/usefulness/issue-31561.rs b/tests/ui/pattern/usefulness/issue-31561.rs
new file mode 100644
index 000000000..82414f041
--- /dev/null
+++ b/tests/ui/pattern/usefulness/issue-31561.rs
@@ -0,0 +1,11 @@
+enum Thing {
+ Foo(u8),
+ Bar,
+ Baz
+}
+
+fn main() {
+ let Thing::Foo(y) = Thing::Foo(1);
+ //~^ ERROR refutable pattern in local binding
+ //~| `Thing::Bar` and `Thing::Baz` not covered
+}
diff --git a/tests/ui/pattern/usefulness/issue-31561.stderr b/tests/ui/pattern/usefulness/issue-31561.stderr
new file mode 100644
index 000000000..5367de5e5
--- /dev/null
+++ b/tests/ui/pattern/usefulness/issue-31561.stderr
@@ -0,0 +1,27 @@
+error[E0005]: refutable pattern in local binding
+ --> $DIR/issue-31561.rs:8:9
+ |
+LL | let Thing::Foo(y) = Thing::Foo(1);
+ | ^^^^^^^^^^^^^ patterns `Thing::Bar` and `Thing::Baz` not covered
+ |
+ = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
+ = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
+note: `Thing` defined here
+ --> $DIR/issue-31561.rs:1:6
+ |
+LL | enum Thing {
+ | ^^^^^
+LL | Foo(u8),
+LL | Bar,
+ | --- not covered
+LL | Baz
+ | --- not covered
+ = note: the matched value is of type `Thing`
+help: you might want to use `let else` to handle the variants that aren't matched
+ |
+LL | let Thing::Foo(y) = Thing::Foo(1) else { todo!() };
+ | ++++++++++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0005`.
diff --git a/src/test/ui/pattern/usefulness/issue-35609.rs b/tests/ui/pattern/usefulness/issue-35609.rs
index 8ef75e351..8ef75e351 100644
--- a/src/test/ui/pattern/usefulness/issue-35609.rs
+++ b/tests/ui/pattern/usefulness/issue-35609.rs
diff --git a/src/test/ui/pattern/usefulness/issue-35609.stderr b/tests/ui/pattern/usefulness/issue-35609.stderr
index c9781d52e..12113957d 100644
--- a/src/test/ui/pattern/usefulness/issue-35609.stderr
+++ b/tests/ui/pattern/usefulness/issue-35609.stderr
@@ -107,9 +107,6 @@ LL | match Some(A) {
|
note: `Option<Enum>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
- |
-LL | pub enum Option<T> {
- | ^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `Option<Enum>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
|
diff --git a/src/test/ui/pattern/usefulness/issue-3601.rs b/tests/ui/pattern/usefulness/issue-3601.rs
index 6215a2398..6215a2398 100644
--- a/src/test/ui/pattern/usefulness/issue-3601.rs
+++ b/tests/ui/pattern/usefulness/issue-3601.rs
diff --git a/src/test/ui/pattern/usefulness/issue-3601.stderr b/tests/ui/pattern/usefulness/issue-3601.stderr
index eb8c63919..59d7bcd4b 100644
--- a/src/test/ui/pattern/usefulness/issue-3601.stderr
+++ b/tests/ui/pattern/usefulness/issue-3601.stderr
@@ -6,12 +6,6 @@ LL | box NodeKind::Element(ed) => match ed.kind {
|
note: `Box<ElementKind>` defined here
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
- |
-LL | / pub struct Box<
-LL | | T: ?Sized,
-LL | | #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,
-LL | | >(Unique<T>, A);
- | |_^
= note: the matched value is of type `Box<ElementKind>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
diff --git a/src/test/ui/pattern/usefulness/issue-39362.rs b/tests/ui/pattern/usefulness/issue-39362.rs
index ea3c8f88e..ea3c8f88e 100644
--- a/src/test/ui/pattern/usefulness/issue-39362.rs
+++ b/tests/ui/pattern/usefulness/issue-39362.rs
diff --git a/src/test/ui/pattern/usefulness/issue-39362.stderr b/tests/ui/pattern/usefulness/issue-39362.stderr
index b8b17918a..b8b17918a 100644
--- a/src/test/ui/pattern/usefulness/issue-39362.stderr
+++ b/tests/ui/pattern/usefulness/issue-39362.stderr
diff --git a/src/test/ui/pattern/usefulness/issue-40221.rs b/tests/ui/pattern/usefulness/issue-40221.rs
index e1f7e975b..e1f7e975b 100644
--- a/src/test/ui/pattern/usefulness/issue-40221.rs
+++ b/tests/ui/pattern/usefulness/issue-40221.rs
diff --git a/src/test/ui/pattern/usefulness/issue-40221.stderr b/tests/ui/pattern/usefulness/issue-40221.stderr
index 4973e42b0..4973e42b0 100644
--- a/src/test/ui/pattern/usefulness/issue-40221.stderr
+++ b/tests/ui/pattern/usefulness/issue-40221.stderr
diff --git a/src/test/ui/pattern/usefulness/issue-4321.rs b/tests/ui/pattern/usefulness/issue-4321.rs
index 9715f2eba..9715f2eba 100644
--- a/src/test/ui/pattern/usefulness/issue-4321.rs
+++ b/tests/ui/pattern/usefulness/issue-4321.rs
diff --git a/src/test/ui/pattern/usefulness/issue-4321.stderr b/tests/ui/pattern/usefulness/issue-4321.stderr
index 293273174..293273174 100644
--- a/src/test/ui/pattern/usefulness/issue-4321.stderr
+++ b/tests/ui/pattern/usefulness/issue-4321.stderr
diff --git a/src/test/ui/pattern/usefulness/issue-50900.rs b/tests/ui/pattern/usefulness/issue-50900.rs
index 9cc760e9a..9cc760e9a 100644
--- a/src/test/ui/pattern/usefulness/issue-50900.rs
+++ b/tests/ui/pattern/usefulness/issue-50900.rs
diff --git a/src/test/ui/pattern/usefulness/issue-50900.stderr b/tests/ui/pattern/usefulness/issue-50900.stderr
index 348246d28..348246d28 100644
--- a/src/test/ui/pattern/usefulness/issue-50900.stderr
+++ b/tests/ui/pattern/usefulness/issue-50900.stderr
diff --git a/src/test/ui/pattern/usefulness/issue-53820-slice-pattern-large-array.rs b/tests/ui/pattern/usefulness/issue-53820-slice-pattern-large-array.rs
index 5b0482de2..5b0482de2 100644
--- a/src/test/ui/pattern/usefulness/issue-53820-slice-pattern-large-array.rs
+++ b/tests/ui/pattern/usefulness/issue-53820-slice-pattern-large-array.rs
diff --git a/src/test/ui/pattern/usefulness/issue-56379.rs b/tests/ui/pattern/usefulness/issue-56379.rs
index 097cf98d0..097cf98d0 100644
--- a/src/test/ui/pattern/usefulness/issue-56379.rs
+++ b/tests/ui/pattern/usefulness/issue-56379.rs
diff --git a/src/test/ui/pattern/usefulness/issue-56379.stderr b/tests/ui/pattern/usefulness/issue-56379.stderr
index 6eed6bfae..6eed6bfae 100644
--- a/src/test/ui/pattern/usefulness/issue-56379.stderr
+++ b/tests/ui/pattern/usefulness/issue-56379.stderr
diff --git a/src/test/ui/pattern/usefulness/issue-57472.rs b/tests/ui/pattern/usefulness/issue-57472.rs
index 113100637..113100637 100644
--- a/src/test/ui/pattern/usefulness/issue-57472.rs
+++ b/tests/ui/pattern/usefulness/issue-57472.rs
diff --git a/src/test/ui/pattern/usefulness/issue-57472.stderr b/tests/ui/pattern/usefulness/issue-57472.stderr
index 26efdf6db..26efdf6db 100644
--- a/src/test/ui/pattern/usefulness/issue-57472.stderr
+++ b/tests/ui/pattern/usefulness/issue-57472.stderr
diff --git a/src/test/ui/pattern/usefulness/issue-65413-constants-and-slices-exhaustiveness.rs b/tests/ui/pattern/usefulness/issue-65413-constants-and-slices-exhaustiveness.rs
index 54dfa889e..54dfa889e 100644
--- a/src/test/ui/pattern/usefulness/issue-65413-constants-and-slices-exhaustiveness.rs
+++ b/tests/ui/pattern/usefulness/issue-65413-constants-and-slices-exhaustiveness.rs
diff --git a/src/test/ui/pattern/usefulness/issue-66501.rs b/tests/ui/pattern/usefulness/issue-66501.rs
index ffcfd4ad8..ffcfd4ad8 100644
--- a/src/test/ui/pattern/usefulness/issue-66501.rs
+++ b/tests/ui/pattern/usefulness/issue-66501.rs
diff --git a/src/test/ui/pattern/usefulness/issue-71930-type-of-match-scrutinee.rs b/tests/ui/pattern/usefulness/issue-71930-type-of-match-scrutinee.rs
index e2ff9ac87..e2ff9ac87 100644
--- a/src/test/ui/pattern/usefulness/issue-71930-type-of-match-scrutinee.rs
+++ b/tests/ui/pattern/usefulness/issue-71930-type-of-match-scrutinee.rs
diff --git a/src/test/ui/pattern/usefulness/issue-72377.rs b/tests/ui/pattern/usefulness/issue-72377.rs
index b5ad3075c..b5ad3075c 100644
--- a/src/test/ui/pattern/usefulness/issue-72377.rs
+++ b/tests/ui/pattern/usefulness/issue-72377.rs
diff --git a/src/test/ui/pattern/usefulness/issue-72377.stderr b/tests/ui/pattern/usefulness/issue-72377.stderr
index 123dd051d..123dd051d 100644
--- a/src/test/ui/pattern/usefulness/issue-72377.stderr
+++ b/tests/ui/pattern/usefulness/issue-72377.stderr
diff --git a/src/test/ui/pattern/usefulness/issue-72476-and-89393-associated-type.rs b/tests/ui/pattern/usefulness/issue-72476-and-89393-associated-type.rs
index 058f41967..058f41967 100644
--- a/src/test/ui/pattern/usefulness/issue-72476-and-89393-associated-type.rs
+++ b/tests/ui/pattern/usefulness/issue-72476-and-89393-associated-type.rs
diff --git a/src/test/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.rs b/tests/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.rs
index cbfcf0eaf..cbfcf0eaf 100644
--- a/src/test/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.rs
+++ b/tests/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.rs
diff --git a/src/test/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.stderr b/tests/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.stderr
index bf05d616d..bf05d616d 100644
--- a/src/test/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.stderr
+++ b/tests/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.stderr
diff --git a/src/test/ui/pattern/usefulness/issue-78549-ref-pat-and-str.rs b/tests/ui/pattern/usefulness/issue-78549-ref-pat-and-str.rs
index 2879caf2c..2879caf2c 100644
--- a/src/test/ui/pattern/usefulness/issue-78549-ref-pat-and-str.rs
+++ b/tests/ui/pattern/usefulness/issue-78549-ref-pat-and-str.rs
diff --git a/src/test/ui/pattern/usefulness/issue-80501-or-pat-and-macro.rs b/tests/ui/pattern/usefulness/issue-80501-or-pat-and-macro.rs
index aac7d7d53..aac7d7d53 100644
--- a/src/test/ui/pattern/usefulness/issue-80501-or-pat-and-macro.rs
+++ b/tests/ui/pattern/usefulness/issue-80501-or-pat-and-macro.rs
diff --git a/src/test/ui/pattern/usefulness/issue-82772-match-box-as-struct.rs b/tests/ui/pattern/usefulness/issue-82772-match-box-as-struct.rs
index c1bfcc734..c1bfcc734 100644
--- a/src/test/ui/pattern/usefulness/issue-82772-match-box-as-struct.rs
+++ b/tests/ui/pattern/usefulness/issue-82772-match-box-as-struct.rs
diff --git a/src/test/ui/pattern/usefulness/issue-82772-match-box-as-struct.stderr b/tests/ui/pattern/usefulness/issue-82772-match-box-as-struct.stderr
index 2c8c85bb1..2c8c85bb1 100644
--- a/src/test/ui/pattern/usefulness/issue-82772-match-box-as-struct.stderr
+++ b/tests/ui/pattern/usefulness/issue-82772-match-box-as-struct.stderr
diff --git a/src/test/ui/pattern/usefulness/issue-88747.rs b/tests/ui/pattern/usefulness/issue-88747.rs
index 948c99f9c..948c99f9c 100644
--- a/src/test/ui/pattern/usefulness/issue-88747.rs
+++ b/tests/ui/pattern/usefulness/issue-88747.rs
diff --git a/src/test/ui/pattern/usefulness/match-arm-statics-2.rs b/tests/ui/pattern/usefulness/match-arm-statics-2.rs
index 3c9c16561..3c9c16561 100644
--- a/src/test/ui/pattern/usefulness/match-arm-statics-2.rs
+++ b/tests/ui/pattern/usefulness/match-arm-statics-2.rs
diff --git a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr b/tests/ui/pattern/usefulness/match-arm-statics-2.stderr
index b0d7fe5eb..e4dd35a59 100644
--- a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr
+++ b/tests/ui/pattern/usefulness/match-arm-statics-2.stderr
@@ -19,15 +19,11 @@ LL | match Some(Some(North)) {
|
note: `Option<Option<Direction>>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
+ ::: $SRC_DIR/core/src/option.rs:LL:COL
|
-LL | pub enum Option<T> {
- | ------------------
-...
-LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
- | ^^^^
- | |
- | not covered
- | not covered
+ = note: not covered
+ |
+ = note: not covered
= note: the matched value is of type `Option<Option<Direction>>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
diff --git a/src/test/ui/pattern/usefulness/match-arm-statics.rs b/tests/ui/pattern/usefulness/match-arm-statics.rs
index 91db76ebb..91db76ebb 100644
--- a/src/test/ui/pattern/usefulness/match-arm-statics.rs
+++ b/tests/ui/pattern/usefulness/match-arm-statics.rs
diff --git a/src/test/ui/pattern/usefulness/match-arm-statics.stderr b/tests/ui/pattern/usefulness/match-arm-statics.stderr
index a5dffebf6..a5dffebf6 100644
--- a/src/test/ui/pattern/usefulness/match-arm-statics.stderr
+++ b/tests/ui/pattern/usefulness/match-arm-statics.stderr
diff --git a/src/test/ui/pattern/usefulness/match-byte-array-patterns-2.rs b/tests/ui/pattern/usefulness/match-byte-array-patterns-2.rs
index 33468d03f..33468d03f 100644
--- a/src/test/ui/pattern/usefulness/match-byte-array-patterns-2.rs
+++ b/tests/ui/pattern/usefulness/match-byte-array-patterns-2.rs
diff --git a/src/test/ui/pattern/usefulness/match-byte-array-patterns-2.stderr b/tests/ui/pattern/usefulness/match-byte-array-patterns-2.stderr
index a90f32f7a..a90f32f7a 100644
--- a/src/test/ui/pattern/usefulness/match-byte-array-patterns-2.stderr
+++ b/tests/ui/pattern/usefulness/match-byte-array-patterns-2.stderr
diff --git a/src/test/ui/pattern/usefulness/match-byte-array-patterns.rs b/tests/ui/pattern/usefulness/match-byte-array-patterns.rs
index 9b6c8bd55..9b6c8bd55 100644
--- a/src/test/ui/pattern/usefulness/match-byte-array-patterns.rs
+++ b/tests/ui/pattern/usefulness/match-byte-array-patterns.rs
diff --git a/src/test/ui/pattern/usefulness/match-byte-array-patterns.stderr b/tests/ui/pattern/usefulness/match-byte-array-patterns.stderr
index 0c582be8d..0c582be8d 100644
--- a/src/test/ui/pattern/usefulness/match-byte-array-patterns.stderr
+++ b/tests/ui/pattern/usefulness/match-byte-array-patterns.stderr
diff --git a/src/test/ui/pattern/usefulness/match-non-exhaustive.rs b/tests/ui/pattern/usefulness/match-non-exhaustive.rs
index 3b210a115..3b210a115 100644
--- a/src/test/ui/pattern/usefulness/match-non-exhaustive.rs
+++ b/tests/ui/pattern/usefulness/match-non-exhaustive.rs
diff --git a/src/test/ui/pattern/usefulness/match-non-exhaustive.stderr b/tests/ui/pattern/usefulness/match-non-exhaustive.stderr
index 08dde523a..08dde523a 100644
--- a/src/test/ui/pattern/usefulness/match-non-exhaustive.stderr
+++ b/tests/ui/pattern/usefulness/match-non-exhaustive.stderr
diff --git a/src/test/ui/pattern/usefulness/match-privately-empty.rs b/tests/ui/pattern/usefulness/match-privately-empty.rs
index 315eb03d1..315eb03d1 100644
--- a/src/test/ui/pattern/usefulness/match-privately-empty.rs
+++ b/tests/ui/pattern/usefulness/match-privately-empty.rs
diff --git a/src/test/ui/pattern/usefulness/match-privately-empty.stderr b/tests/ui/pattern/usefulness/match-privately-empty.stderr
index 4607cfaae..86f75d15c 100644
--- a/src/test/ui/pattern/usefulness/match-privately-empty.stderr
+++ b/tests/ui/pattern/usefulness/match-privately-empty.stderr
@@ -6,12 +6,9 @@ LL | match private::DATA {
|
note: `Option<Private>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
+ ::: $SRC_DIR/core/src/option.rs:LL:COL
|
-LL | pub enum Option<T> {
- | ------------------
-...
-LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
- | ^^^^ not covered
+ = note: not covered
= note: the matched value is of type `Option<Private>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
diff --git a/src/test/ui/pattern/usefulness/match-ref-ice.rs b/tests/ui/pattern/usefulness/match-ref-ice.rs
index dee110f96..dee110f96 100644
--- a/src/test/ui/pattern/usefulness/match-ref-ice.rs
+++ b/tests/ui/pattern/usefulness/match-ref-ice.rs
diff --git a/src/test/ui/pattern/usefulness/match-ref-ice.stderr b/tests/ui/pattern/usefulness/match-ref-ice.stderr
index fad0940ba..fad0940ba 100644
--- a/src/test/ui/pattern/usefulness/match-ref-ice.stderr
+++ b/tests/ui/pattern/usefulness/match-ref-ice.stderr
diff --git a/src/test/ui/pattern/usefulness/match-slice-patterns.rs b/tests/ui/pattern/usefulness/match-slice-patterns.rs
index 92d74b8c2..92d74b8c2 100644
--- a/src/test/ui/pattern/usefulness/match-slice-patterns.rs
+++ b/tests/ui/pattern/usefulness/match-slice-patterns.rs
diff --git a/src/test/ui/pattern/usefulness/match-slice-patterns.stderr b/tests/ui/pattern/usefulness/match-slice-patterns.stderr
index 961dd5901..961dd5901 100644
--- a/src/test/ui/pattern/usefulness/match-slice-patterns.stderr
+++ b/tests/ui/pattern/usefulness/match-slice-patterns.stderr
diff --git a/src/test/ui/pattern/usefulness/match-vec-fixed.rs b/tests/ui/pattern/usefulness/match-vec-fixed.rs
index e611779de..e611779de 100644
--- a/src/test/ui/pattern/usefulness/match-vec-fixed.rs
+++ b/tests/ui/pattern/usefulness/match-vec-fixed.rs
diff --git a/src/test/ui/pattern/usefulness/match-vec-fixed.stderr b/tests/ui/pattern/usefulness/match-vec-fixed.stderr
index e388a06cb..e388a06cb 100644
--- a/src/test/ui/pattern/usefulness/match-vec-fixed.stderr
+++ b/tests/ui/pattern/usefulness/match-vec-fixed.stderr
diff --git a/src/test/ui/pattern/usefulness/match-vec-unreachable.rs b/tests/ui/pattern/usefulness/match-vec-unreachable.rs
index 3342389be..3342389be 100644
--- a/src/test/ui/pattern/usefulness/match-vec-unreachable.rs
+++ b/tests/ui/pattern/usefulness/match-vec-unreachable.rs
diff --git a/src/test/ui/pattern/usefulness/match-vec-unreachable.stderr b/tests/ui/pattern/usefulness/match-vec-unreachable.stderr
index 672fd92fb..672fd92fb 100644
--- a/src/test/ui/pattern/usefulness/match-vec-unreachable.stderr
+++ b/tests/ui/pattern/usefulness/match-vec-unreachable.stderr
diff --git a/src/test/ui/pattern/usefulness/nested-exhaustive-match.rs b/tests/ui/pattern/usefulness/nested-exhaustive-match.rs
index 8b2294f84..8b2294f84 100644
--- a/src/test/ui/pattern/usefulness/nested-exhaustive-match.rs
+++ b/tests/ui/pattern/usefulness/nested-exhaustive-match.rs
diff --git a/tests/ui/pattern/usefulness/non-exhaustive-defined-here.rs b/tests/ui/pattern/usefulness/non-exhaustive-defined-here.rs
new file mode 100644
index 000000000..5145f7690
--- /dev/null
+++ b/tests/ui/pattern/usefulness/non-exhaustive-defined-here.rs
@@ -0,0 +1,107 @@
+// Test the "defined here" and "not covered" diagnostic hints.
+// We also make sure that references are peeled off from the scrutinee type
+// so that the diagnostics work better with default binding modes.
+
+#[derive(Clone)]
+enum E {
+ //~^ NOTE
+ //~| NOTE
+ //~| NOTE
+ //~| NOTE
+ //~| NOTE
+ //~| NOTE
+ A,
+ B,
+ //~^ NOTE `E` defined here
+ //~| NOTE `E` defined here
+ //~| NOTE `E` defined here
+ //~| NOTE not covered
+ //~| NOTE not covered
+ //~| NOTE not covered
+ //~| NOTE not covered
+ //~| NOTE not covered
+ //~| NOTE not covered
+ C
+ //~^ not covered
+ //~| not covered
+ //~| not covered
+ //~| not covered
+ //~| not covered
+ //~| not covered
+}
+
+fn by_val(e: E) {
+ let e1 = e.clone();
+ match e1 { //~ ERROR non-exhaustive patterns: `E::B` and `E::C` not covered
+ //~^ NOTE patterns `E::B` and `E::C` not covered
+ //~| NOTE the matched value is of type `E`
+ E::A => {}
+ }
+
+ let E::A = e;
+ //~^ ERROR refutable pattern in local binding
+ //~| patterns `E::B` and `E::C` not covered
+ //~| NOTE `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with
+ //~| NOTE for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
+ //~| NOTE the matched value is of type `E`
+}
+
+fn by_ref_once(e: &E) {
+ match e {
+ //~^ ERROR non-exhaustive patterns
+ //~| patterns `&E::B` and `&E::C` not covered
+ //~| NOTE the matched value is of type `&E`
+ E::A => {}
+ }
+
+ let E::A = e;
+ //~^ ERROR refutable pattern in local binding
+ //~| patterns `&E::B` and `&E::C` not covered
+ //~| NOTE `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with
+ //~| NOTE for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
+ //~| NOTE the matched value is of type `&E`
+}
+
+fn by_ref_thrice(e: & &mut &E) {
+ match e {
+ //~^ ERROR non-exhaustive patterns
+ //~| patterns `&&mut &E::B` and `&&mut &E::C` not covered
+ //~| NOTE the matched value is of type `&&mut &E`
+ E::A => {}
+ }
+
+ let E::A = e;
+ //~^ ERROR refutable pattern in local binding
+ //~| patterns `&&mut &E::B` and `&&mut &E::C` not covered
+ //~| NOTE `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with
+ //~| NOTE for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
+ //~| NOTE the matched value is of type `&&mut &E`
+}
+
+enum Opt {
+ //~^ NOTE
+ //~| NOTE
+ Some(u8),
+ None,
+ //~^ NOTE `Opt` defined here
+ //~| NOTE not covered
+ //~| NOTE not covered
+}
+
+fn ref_pat(e: Opt) {
+ match e {
+ //~^ ERROR non-exhaustive patterns
+ //~| pattern `Opt::None` not covered
+ //~| NOTE the matched value is of type `Opt`
+ Opt::Some(ref _x) => {}
+ }
+
+ let Opt::Some(ref _x) = e;
+ //~^ ERROR refutable pattern in local binding
+ //~| NOTE the matched value is of type `Opt`
+ //~| NOTE pattern `Opt::None` not covered
+ //~| NOTE `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with
+ //~| NOTE for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
+}
+
+fn main() {}
diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-defined-here.stderr b/tests/ui/pattern/usefulness/non-exhaustive-defined-here.stderr
index 678c9b2ab..769d4070f 100644
--- a/src/test/ui/pattern/usefulness/non-exhaustive-defined-here.stderr
+++ b/tests/ui/pattern/usefulness/non-exhaustive-defined-here.stderr
@@ -1,5 +1,5 @@
error[E0004]: non-exhaustive patterns: `E::B` and `E::C` not covered
- --> $DIR/non-exhaustive-defined-here.rs:38:11
+ --> $DIR/non-exhaustive-defined-here.rs:35:11
|
LL | match e1 {
| ^^ patterns `E::B` and `E::C` not covered
@@ -22,8 +22,8 @@ LL ~ E::A => {}
LL + E::B | E::C => todo!()
|
-error[E0005]: refutable pattern in local binding: `E::B` and `E::C` not covered
- --> $DIR/non-exhaustive-defined-here.rs:44:9
+error[E0005]: refutable pattern in local binding
+ --> $DIR/non-exhaustive-defined-here.rs:41:9
|
LL | let E::A = e;
| ^^^^ patterns `E::B` and `E::C` not covered
@@ -31,16 +31,16 @@ LL | let E::A = e;
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `E` defined here
- --> $DIR/non-exhaustive-defined-here.rs:14:5
+ --> $DIR/non-exhaustive-defined-here.rs:6:6
|
LL | enum E {
- | -
+ | ^
...
LL | B,
- | ^ not covered
+ | - not covered
...
LL | C
- | ^ not covered
+ | - not covered
= note: the matched value is of type `E`
help: you might want to use `if let` to ignore the variants that aren't matched
|
@@ -48,7 +48,7 @@ LL | if let E::A = e { todo!() }
| ++ ~~~~~~~~~~~
error[E0004]: non-exhaustive patterns: `&E::B` and `&E::C` not covered
- --> $DIR/non-exhaustive-defined-here.rs:52:11
+ --> $DIR/non-exhaustive-defined-here.rs:50:11
|
LL | match e {
| ^ patterns `&E::B` and `&E::C` not covered
@@ -71,8 +71,8 @@ LL ~ E::A => {}
LL + &E::B | &E::C => todo!()
|
-error[E0005]: refutable pattern in local binding: `&E::B` and `&E::C` not covered
- --> $DIR/non-exhaustive-defined-here.rs:58:9
+error[E0005]: refutable pattern in local binding
+ --> $DIR/non-exhaustive-defined-here.rs:57:9
|
LL | let E::A = e;
| ^^^^ patterns `&E::B` and `&E::C` not covered
@@ -80,16 +80,16 @@ LL | let E::A = e;
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `E` defined here
- --> $DIR/non-exhaustive-defined-here.rs:14:5
+ --> $DIR/non-exhaustive-defined-here.rs:6:6
|
LL | enum E {
- | -
+ | ^
...
LL | B,
- | ^ not covered
+ | - not covered
...
LL | C
- | ^ not covered
+ | - not covered
= note: the matched value is of type `&E`
help: you might want to use `if let` to ignore the variants that aren't matched
|
@@ -120,8 +120,8 @@ LL ~ E::A => {}
LL + &&mut &E::B | &&mut &E::C => todo!()
|
-error[E0005]: refutable pattern in local binding: `&&mut &E::B` and `&&mut &E::C` not covered
- --> $DIR/non-exhaustive-defined-here.rs:72:9
+error[E0005]: refutable pattern in local binding
+ --> $DIR/non-exhaustive-defined-here.rs:73:9
|
LL | let E::A = e;
| ^^^^ patterns `&&mut &E::B` and `&&mut &E::C` not covered
@@ -129,16 +129,16 @@ LL | let E::A = e;
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `E` defined here
- --> $DIR/non-exhaustive-defined-here.rs:14:5
+ --> $DIR/non-exhaustive-defined-here.rs:6:6
|
LL | enum E {
- | -
+ | ^
...
LL | B,
- | ^ not covered
+ | - not covered
...
LL | C
- | ^ not covered
+ | - not covered
= note: the matched value is of type `&&mut &E`
help: you might want to use `if let` to ignore the variants that aren't matched
|
@@ -152,7 +152,7 @@ LL | match e {
| ^ pattern `Opt::None` not covered
|
note: `Opt` defined here
- --> $DIR/non-exhaustive-defined-here.rs:84:5
+ --> $DIR/non-exhaustive-defined-here.rs:85:5
|
LL | enum Opt {
| ---
@@ -166,8 +166,8 @@ LL ~ Opt::Some(ref _x) => {}
LL + Opt::None => todo!()
|
-error[E0005]: refutable pattern in local binding: `Opt::None` not covered
- --> $DIR/non-exhaustive-defined-here.rs:98:9
+error[E0005]: refutable pattern in local binding
+ --> $DIR/non-exhaustive-defined-here.rs:99:9
|
LL | let Opt::Some(ref _x) = e;
| ^^^^^^^^^^^^^^^^^ pattern `Opt::None` not covered
@@ -175,19 +175,15 @@ LL | let Opt::Some(ref _x) = e;
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Opt` defined here
- --> $DIR/non-exhaustive-defined-here.rs:84:5
+ --> $DIR/non-exhaustive-defined-here.rs:81:6
|
LL | enum Opt {
- | ---
+ | ^^^
...
LL | None,
- | ^^^^ not covered
+ | ---- not covered
= note: the matched value is of type `Opt`
-help: you might want to use `if let` to ignore the variant that isn't matched
- |
-LL | let _x = if let Opt::Some(ref _x) = e { _x } else { todo!() };
- | +++++++++++ +++++++++++++++++++++++
-help: alternatively, you might want to use let else to handle the variant that isn't matched
+help: you might want to use `let else` to handle the variant that isn't matched
|
LL | let Opt::Some(ref _x) = e else { todo!() };
| ++++++++++++++++
diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-match-nested.rs b/tests/ui/pattern/usefulness/non-exhaustive-match-nested.rs
index 69c3c7658..69c3c7658 100644
--- a/src/test/ui/pattern/usefulness/non-exhaustive-match-nested.rs
+++ b/tests/ui/pattern/usefulness/non-exhaustive-match-nested.rs
diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-match-nested.stderr b/tests/ui/pattern/usefulness/non-exhaustive-match-nested.stderr
index 44f327421..44f327421 100644
--- a/src/test/ui/pattern/usefulness/non-exhaustive-match-nested.stderr
+++ b/tests/ui/pattern/usefulness/non-exhaustive-match-nested.stderr
diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-match.rs b/tests/ui/pattern/usefulness/non-exhaustive-match.rs
index 1cb58b8ce..1cb58b8ce 100644
--- a/src/test/ui/pattern/usefulness/non-exhaustive-match.rs
+++ b/tests/ui/pattern/usefulness/non-exhaustive-match.rs
diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr b/tests/ui/pattern/usefulness/non-exhaustive-match.stderr
index 4234600d0..e2260f50b 100644
--- a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr
+++ b/tests/ui/pattern/usefulness/non-exhaustive-match.stderr
@@ -36,12 +36,9 @@ LL | match Some(10) {
|
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
+ ::: $SRC_DIR/core/src/option.rs:LL:COL
|
-LL | pub enum Option<T> {
- | ------------------
-...
-LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
- | ^^^^ not covered
+ = note: not covered
= note: the matched value is of type `Option<i32>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.rs b/tests/ui/pattern/usefulness/non-exhaustive-pattern-witness.rs
index 4bd344219..4bd344219 100644
--- a/src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.rs
+++ b/tests/ui/pattern/usefulness/non-exhaustive-pattern-witness.rs
diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.stderr b/tests/ui/pattern/usefulness/non-exhaustive-pattern-witness.stderr
index b8af566de..b8af566de 100644
--- a/src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.stderr
+++ b/tests/ui/pattern/usefulness/non-exhaustive-pattern-witness.stderr
diff --git a/tests/ui/pattern/usefulness/refutable-pattern-errors.rs b/tests/ui/pattern/usefulness/refutable-pattern-errors.rs
new file mode 100644
index 000000000..7a3e991d5
--- /dev/null
+++ b/tests/ui/pattern/usefulness/refutable-pattern-errors.rs
@@ -0,0 +1,9 @@
+fn func((1, (Some(1), 2..=3)): (isize, (Option<isize>, isize))) { }
+//~^ ERROR refutable pattern in function argument
+//~| `(_, _)` not covered
+
+fn main() {
+ let (1, (Some(1), 2..=3)) = (1, (None, 2));
+ //~^ ERROR refutable pattern in local binding
+ //~| `(i32::MIN..=0_i32, _)` and `(2_i32..=i32::MAX, _)` not covered
+}
diff --git a/src/test/ui/pattern/usefulness/refutable-pattern-errors.stderr b/tests/ui/pattern/usefulness/refutable-pattern-errors.stderr
index d1dacc822..c518de477 100644
--- a/src/test/ui/pattern/usefulness/refutable-pattern-errors.stderr
+++ b/tests/ui/pattern/usefulness/refutable-pattern-errors.stderr
@@ -1,4 +1,4 @@
-error[E0005]: refutable pattern in function argument: `(_, _)` not covered
+error[E0005]: refutable pattern in function argument
--> $DIR/refutable-pattern-errors.rs:1:9
|
LL | fn func((1, (Some(1), 2..=3)): (isize, (Option<isize>, isize))) { }
@@ -6,8 +6,8 @@ LL | fn func((1, (Some(1), 2..=3)): (isize, (Option<isize>, isize))) { }
|
= note: the matched value is of type `(isize, (Option<isize>, isize))`
-error[E0005]: refutable pattern in local binding: `(i32::MIN..=0_i32, _)` and `(2_i32..=i32::MAX, _)` not covered
- --> $DIR/refutable-pattern-errors.rs:5:9
+error[E0005]: refutable pattern in local binding
+ --> $DIR/refutable-pattern-errors.rs:6:9
|
LL | let (1, (Some(1), 2..=3)) = (1, (None, 2));
| ^^^^^^^^^^^^^^^^^^^^^ patterns `(i32::MIN..=0_i32, _)` and `(2_i32..=i32::MAX, _)` not covered
diff --git a/tests/ui/pattern/usefulness/refutable-pattern-in-fn-arg.rs b/tests/ui/pattern/usefulness/refutable-pattern-in-fn-arg.rs
new file mode 100644
index 000000000..17dc38ab2
--- /dev/null
+++ b/tests/ui/pattern/usefulness/refutable-pattern-in-fn-arg.rs
@@ -0,0 +1,6 @@
+fn main() {
+ let f = |3: isize| println!("hello");
+ //~^ ERROR refutable pattern in function argument
+ //~| `_` not covered
+ f(4);
+}
diff --git a/src/test/ui/pattern/usefulness/refutable-pattern-in-fn-arg.stderr b/tests/ui/pattern/usefulness/refutable-pattern-in-fn-arg.stderr
index c9d8cf43f..55f0b2319 100644
--- a/src/test/ui/pattern/usefulness/refutable-pattern-in-fn-arg.stderr
+++ b/tests/ui/pattern/usefulness/refutable-pattern-in-fn-arg.stderr
@@ -1,4 +1,4 @@
-error[E0005]: refutable pattern in function argument: `_` not covered
+error[E0005]: refutable pattern in function argument
--> $DIR/refutable-pattern-in-fn-arg.rs:2:14
|
LL | let f = |3: isize| println!("hello");
diff --git a/src/test/ui/pattern/usefulness/slice-pattern-const-2.rs b/tests/ui/pattern/usefulness/slice-pattern-const-2.rs
index 4bf8d0fd2..4bf8d0fd2 100644
--- a/src/test/ui/pattern/usefulness/slice-pattern-const-2.rs
+++ b/tests/ui/pattern/usefulness/slice-pattern-const-2.rs
diff --git a/src/test/ui/pattern/usefulness/slice-pattern-const-2.stderr b/tests/ui/pattern/usefulness/slice-pattern-const-2.stderr
index dcad11a38..dcad11a38 100644
--- a/src/test/ui/pattern/usefulness/slice-pattern-const-2.stderr
+++ b/tests/ui/pattern/usefulness/slice-pattern-const-2.stderr
diff --git a/src/test/ui/pattern/usefulness/slice-pattern-const-3.rs b/tests/ui/pattern/usefulness/slice-pattern-const-3.rs
index 2ca8323f0..2ca8323f0 100644
--- a/src/test/ui/pattern/usefulness/slice-pattern-const-3.rs
+++ b/tests/ui/pattern/usefulness/slice-pattern-const-3.rs
diff --git a/src/test/ui/pattern/usefulness/slice-pattern-const-3.stderr b/tests/ui/pattern/usefulness/slice-pattern-const-3.stderr
index b90b3a88a..b90b3a88a 100644
--- a/src/test/ui/pattern/usefulness/slice-pattern-const-3.stderr
+++ b/tests/ui/pattern/usefulness/slice-pattern-const-3.stderr
diff --git a/src/test/ui/pattern/usefulness/slice-pattern-const.rs b/tests/ui/pattern/usefulness/slice-pattern-const.rs
index 89195d5b1..89195d5b1 100644
--- a/src/test/ui/pattern/usefulness/slice-pattern-const.rs
+++ b/tests/ui/pattern/usefulness/slice-pattern-const.rs
diff --git a/src/test/ui/pattern/usefulness/slice-pattern-const.stderr b/tests/ui/pattern/usefulness/slice-pattern-const.stderr
index 1fffb9fed..1fffb9fed 100644
--- a/src/test/ui/pattern/usefulness/slice-pattern-const.stderr
+++ b/tests/ui/pattern/usefulness/slice-pattern-const.stderr
diff --git a/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.rs b/tests/ui/pattern/usefulness/slice-patterns-exhaustiveness.rs
index 46e0da5be..46e0da5be 100644
--- a/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.rs
+++ b/tests/ui/pattern/usefulness/slice-patterns-exhaustiveness.rs
diff --git a/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr b/tests/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr
index 5d1e170ae..5d1e170ae 100644
--- a/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr
+++ b/tests/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr
diff --git a/src/test/ui/pattern/usefulness/slice-patterns-irrefutable.rs b/tests/ui/pattern/usefulness/slice-patterns-irrefutable.rs
index cbf64e2c5..cbf64e2c5 100644
--- a/src/test/ui/pattern/usefulness/slice-patterns-irrefutable.rs
+++ b/tests/ui/pattern/usefulness/slice-patterns-irrefutable.rs
diff --git a/src/test/ui/pattern/usefulness/slice-patterns-reachability.rs b/tests/ui/pattern/usefulness/slice-patterns-reachability.rs
index 7c747b5e0..7c747b5e0 100644
--- a/src/test/ui/pattern/usefulness/slice-patterns-reachability.rs
+++ b/tests/ui/pattern/usefulness/slice-patterns-reachability.rs
diff --git a/src/test/ui/pattern/usefulness/slice-patterns-reachability.stderr b/tests/ui/pattern/usefulness/slice-patterns-reachability.stderr
index 607ffb765..607ffb765 100644
--- a/src/test/ui/pattern/usefulness/slice-patterns-reachability.stderr
+++ b/tests/ui/pattern/usefulness/slice-patterns-reachability.stderr
diff --git a/src/test/ui/pattern/usefulness/stable-gated-fields.rs b/tests/ui/pattern/usefulness/stable-gated-fields.rs
index 90f40a8d6..90f40a8d6 100644
--- a/src/test/ui/pattern/usefulness/stable-gated-fields.rs
+++ b/tests/ui/pattern/usefulness/stable-gated-fields.rs
diff --git a/src/test/ui/pattern/usefulness/stable-gated-fields.stderr b/tests/ui/pattern/usefulness/stable-gated-fields.stderr
index cf98c51a2..cf98c51a2 100644
--- a/src/test/ui/pattern/usefulness/stable-gated-fields.stderr
+++ b/tests/ui/pattern/usefulness/stable-gated-fields.stderr
diff --git a/src/test/ui/pattern/usefulness/stable-gated-patterns.rs b/tests/ui/pattern/usefulness/stable-gated-patterns.rs
index 03db01160..03db01160 100644
--- a/src/test/ui/pattern/usefulness/stable-gated-patterns.rs
+++ b/tests/ui/pattern/usefulness/stable-gated-patterns.rs
diff --git a/src/test/ui/pattern/usefulness/stable-gated-patterns.stderr b/tests/ui/pattern/usefulness/stable-gated-patterns.stderr
index 7b8588a3c..7b8588a3c 100644
--- a/src/test/ui/pattern/usefulness/stable-gated-patterns.stderr
+++ b/tests/ui/pattern/usefulness/stable-gated-patterns.stderr
diff --git a/src/test/ui/pattern/usefulness/struct-like-enum-nonexhaustive.rs b/tests/ui/pattern/usefulness/struct-like-enum-nonexhaustive.rs
index b1fc0f5ad..b1fc0f5ad 100644
--- a/src/test/ui/pattern/usefulness/struct-like-enum-nonexhaustive.rs
+++ b/tests/ui/pattern/usefulness/struct-like-enum-nonexhaustive.rs
diff --git a/src/test/ui/pattern/usefulness/struct-like-enum-nonexhaustive.stderr b/tests/ui/pattern/usefulness/struct-like-enum-nonexhaustive.stderr
index 85c97be29..85c97be29 100644
--- a/src/test/ui/pattern/usefulness/struct-like-enum-nonexhaustive.stderr
+++ b/tests/ui/pattern/usefulness/struct-like-enum-nonexhaustive.stderr
diff --git a/src/test/ui/pattern/usefulness/struct-pattern-match-useless.rs b/tests/ui/pattern/usefulness/struct-pattern-match-useless.rs
index 93f0a9317..93f0a9317 100644
--- a/src/test/ui/pattern/usefulness/struct-pattern-match-useless.rs
+++ b/tests/ui/pattern/usefulness/struct-pattern-match-useless.rs
diff --git a/src/test/ui/pattern/usefulness/struct-pattern-match-useless.stderr b/tests/ui/pattern/usefulness/struct-pattern-match-useless.stderr
index fbee33de6..fbee33de6 100644
--- a/src/test/ui/pattern/usefulness/struct-pattern-match-useless.stderr
+++ b/tests/ui/pattern/usefulness/struct-pattern-match-useless.stderr
diff --git a/src/test/ui/pattern/usefulness/top-level-alternation.rs b/tests/ui/pattern/usefulness/top-level-alternation.rs
index e8cd12ea4..e8cd12ea4 100644
--- a/src/test/ui/pattern/usefulness/top-level-alternation.rs
+++ b/tests/ui/pattern/usefulness/top-level-alternation.rs
diff --git a/src/test/ui/pattern/usefulness/top-level-alternation.stderr b/tests/ui/pattern/usefulness/top-level-alternation.stderr
index 17fa951c5..17fa951c5 100644
--- a/src/test/ui/pattern/usefulness/top-level-alternation.stderr
+++ b/tests/ui/pattern/usefulness/top-level-alternation.stderr
diff --git a/src/test/ui/pattern/usefulness/tuple-struct-nonexhaustive.rs b/tests/ui/pattern/usefulness/tuple-struct-nonexhaustive.rs
index 76bcf3fbd..76bcf3fbd 100644
--- a/src/test/ui/pattern/usefulness/tuple-struct-nonexhaustive.rs
+++ b/tests/ui/pattern/usefulness/tuple-struct-nonexhaustive.rs
diff --git a/src/test/ui/pattern/usefulness/tuple-struct-nonexhaustive.stderr b/tests/ui/pattern/usefulness/tuple-struct-nonexhaustive.stderr
index e2a65ff85..e2a65ff85 100644
--- a/src/test/ui/pattern/usefulness/tuple-struct-nonexhaustive.stderr
+++ b/tests/ui/pattern/usefulness/tuple-struct-nonexhaustive.stderr
diff --git a/src/test/ui/pattern/usefulness/type_polymorphic_byte_str_literals.rs b/tests/ui/pattern/usefulness/type_polymorphic_byte_str_literals.rs
index cb44c1da7..cb44c1da7 100644
--- a/src/test/ui/pattern/usefulness/type_polymorphic_byte_str_literals.rs
+++ b/tests/ui/pattern/usefulness/type_polymorphic_byte_str_literals.rs
diff --git a/src/test/ui/pattern/usefulness/type_polymorphic_byte_str_literals.stderr b/tests/ui/pattern/usefulness/type_polymorphic_byte_str_literals.stderr
index acae605da..acae605da 100644
--- a/src/test/ui/pattern/usefulness/type_polymorphic_byte_str_literals.stderr
+++ b/tests/ui/pattern/usefulness/type_polymorphic_byte_str_literals.stderr
diff --git a/src/test/ui/pattern/usefulness/uninhabited.rs b/tests/ui/pattern/usefulness/uninhabited.rs
index 5622808d4..5622808d4 100644
--- a/src/test/ui/pattern/usefulness/uninhabited.rs
+++ b/tests/ui/pattern/usefulness/uninhabited.rs
diff --git a/src/test/ui/pattern/usefulness/unstable-gated-fields.rs b/tests/ui/pattern/usefulness/unstable-gated-fields.rs
index 2b473ae98..2b473ae98 100644
--- a/src/test/ui/pattern/usefulness/unstable-gated-fields.rs
+++ b/tests/ui/pattern/usefulness/unstable-gated-fields.rs
diff --git a/src/test/ui/pattern/usefulness/unstable-gated-fields.stderr b/tests/ui/pattern/usefulness/unstable-gated-fields.stderr
index e4f5fa06b..e4f5fa06b 100644
--- a/src/test/ui/pattern/usefulness/unstable-gated-fields.stderr
+++ b/tests/ui/pattern/usefulness/unstable-gated-fields.stderr
diff --git a/src/test/ui/pattern/usefulness/unstable-gated-patterns.rs b/tests/ui/pattern/usefulness/unstable-gated-patterns.rs
index 7046555e0..7046555e0 100644
--- a/src/test/ui/pattern/usefulness/unstable-gated-patterns.rs
+++ b/tests/ui/pattern/usefulness/unstable-gated-patterns.rs
diff --git a/src/test/ui/pattern/usefulness/unstable-gated-patterns.stderr b/tests/ui/pattern/usefulness/unstable-gated-patterns.stderr
index 6dc9a4058..6dc9a4058 100644
--- a/src/test/ui/pattern/usefulness/unstable-gated-patterns.stderr
+++ b/tests/ui/pattern/usefulness/unstable-gated-patterns.stderr