summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/let_underscore_must_use.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /src/tools/clippy/tests/ui/let_underscore_must_use.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/let_underscore_must_use.rs')
-rw-r--r--src/tools/clippy/tests/ui/let_underscore_must_use.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/let_underscore_must_use.rs b/src/tools/clippy/tests/ui/let_underscore_must_use.rs
index 1edb77c74..3290d0877 100644
--- a/src/tools/clippy/tests/ui/let_underscore_must_use.rs
+++ b/src/tools/clippy/tests/ui/let_underscore_must_use.rs
@@ -65,30 +65,42 @@ impl Trait for S {
fn main() {
let _ = f();
+ //~^ ERROR: non-binding `let` on a result of a `#[must_use]` function
let _ = g();
+ //~^ ERROR: non-binding `let` on an expression with `#[must_use]` type
let _ = h();
let _ = l(0_u32);
+ //~^ ERROR: non-binding `let` on a result of a `#[must_use]` function
let s = S {};
let _ = s.f();
+ //~^ ERROR: non-binding `let` on a result of a `#[must_use]` function
let _ = s.g();
+ //~^ ERROR: non-binding `let` on an expression with `#[must_use]` type
let _ = s.k();
let _ = S::h();
+ //~^ ERROR: non-binding `let` on a result of a `#[must_use]` function
let _ = S::p();
+ //~^ ERROR: non-binding `let` on an expression with `#[must_use]` type
let _ = S::a();
+ //~^ ERROR: non-binding `let` on a result of a `#[must_use]` function
let _ = if true { Ok(()) } else { Err(()) };
+ //~^ ERROR: non-binding `let` on an expression with `#[must_use]` type
let a = Result::<(), ()>::Ok(());
let _ = a.is_ok();
+ //~^ ERROR: non-binding `let` on a result of a `#[must_use]` function
let _ = a.map(|_| ());
+ //~^ ERROR: non-binding `let` on an expression with `#[must_use]` type
let _ = a;
+ //~^ ERROR: non-binding `let` on an expression with `#[must_use]` type
#[allow(clippy::let_underscore_must_use)]
let _ = a;