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 --- src/test/ui/lint/unused/unused-result.rs | 42 -------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 src/test/ui/lint/unused/unused-result.rs (limited to 'src/test/ui/lint/unused/unused-result.rs') diff --git a/src/test/ui/lint/unused/unused-result.rs b/src/test/ui/lint/unused/unused-result.rs deleted file mode 100644 index e283eaa88..000000000 --- a/src/test/ui/lint/unused/unused-result.rs +++ /dev/null @@ -1,42 +0,0 @@ -#![allow(dead_code)] -#![deny(unused_results, unused_must_use)] -//~^ NOTE: the lint level is defined here -//~| NOTE: the lint level is defined here - -#[must_use] -enum MustUse { Test } - -#[must_use = "some message"] -enum MustUseMsg { Test2 } - -fn foo() -> T { panic!() } - -fn bar() -> isize { return foo::(); } -fn baz() -> MustUse { return foo::(); } -fn qux() -> MustUseMsg { return foo::(); } - -#[allow(unused_results)] -fn test() { - foo::(); - foo::(); //~ ERROR: unused `MustUse` that must be used - foo::(); //~ ERROR: unused `MustUseMsg` that must be used - //~^ NOTE: some message -} - -#[allow(unused_results, unused_must_use)] -fn test2() { - foo::(); - foo::(); - foo::(); -} - -fn main() { - foo::(); //~ ERROR: unused result of type `isize` - foo::(); //~ ERROR: unused `MustUse` that must be used - foo::(); //~ ERROR: unused `MustUseMsg` that must be used - //~^ NOTE: some message - - let _ = foo::(); - let _ = foo::(); - let _ = foo::(); -} -- cgit v1.2.3