From 8a65eb9a18dba3ec459cc3547469868f10276e64 Mon Sep 17 00:00:00 2001 From: Yoshiki Matsuda Date: Sun, 17 Nov 2024 16:07:45 +0900 Subject: [PATCH] Add a test for issue-132874 --- .../lint/dead-code/issue-132874-false-positive.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/ui/lint/dead-code/issue-132874-false-positive.rs diff --git a/tests/ui/lint/dead-code/issue-132874-false-positive.rs b/tests/ui/lint/dead-code/issue-132874-false-positive.rs new file mode 100644 index 0000000000000..b568486e51dbe --- /dev/null +++ b/tests/ui/lint/dead-code/issue-132874-false-positive.rs @@ -0,0 +1,13 @@ +//@ check-pass + +// Make sure we don't have any false positives here. + +#![deny(dead_code)] + +struct Foo(usize); + +fn get_thing() -> T { todo!() } + +pub fn main() { + let Foo(_x) = get_thing(); +}