From 4547b622d8d29df964fa2914213088b148c498fc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:32 +0200 Subject: Merging upstream version 1.67.1+dfsg1. Signed-off-by: Daniel Baumann --- .../clippy/tests/ui/infallible_destructuring_match.fixed | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/tools/clippy/tests/ui/infallible_destructuring_match.fixed') diff --git a/src/tools/clippy/tests/ui/infallible_destructuring_match.fixed b/src/tools/clippy/tests/ui/infallible_destructuring_match.fixed index b8e40d995..61985e56b 100644 --- a/src/tools/clippy/tests/ui/infallible_destructuring_match.fixed +++ b/src/tools/clippy/tests/ui/infallible_destructuring_match.fixed @@ -9,6 +9,9 @@ enum SingleVariantEnum { struct TupleStruct(i32); +struct NonCopy; +struct TupleStructWithNonCopy(NonCopy); + enum EmptyEnum {} macro_rules! match_enum { @@ -71,6 +74,15 @@ fn infallible_destructuring_match_struct() { let TupleStruct(data) = wrapper; } +fn infallible_destructuring_match_struct_with_noncopy() { + let wrapper = TupleStructWithNonCopy(NonCopy); + + // This should lint! (keeping `ref` in the suggestion) + let TupleStructWithNonCopy(ref data) = wrapper; + + let TupleStructWithNonCopy(ref data) = wrapper; +} + macro_rules! match_never_enum { ($param:expr) => { let data = match $param { -- cgit v1.2.3