From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../lint/dead-code/issue-68408-false-positive.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/ui/lint/dead-code/issue-68408-false-positive.rs (limited to 'tests/ui/lint/dead-code/issue-68408-false-positive.rs') diff --git a/tests/ui/lint/dead-code/issue-68408-false-positive.rs b/tests/ui/lint/dead-code/issue-68408-false-positive.rs new file mode 100644 index 000000000..7ee6b5d72 --- /dev/null +++ b/tests/ui/lint/dead-code/issue-68408-false-positive.rs @@ -0,0 +1,22 @@ +// check-pass + +// Make sure we don't have any false positives here. + +#![deny(dead_code)] + +enum X { + A { _a: () }, + B { _b: () }, +} +impl X { + fn a() -> X { + X::A { _a: () } + } + fn b() -> Self { + Self::B { _b: () } + } +} + +fn main() { + let (_, _) = (X::a(), X::b()); +} -- cgit v1.2.3