From 06826d1d79d9eaef36bb84baec23f6d23329fb8b Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 7 Mar 2022 12:46:05 -0800 Subject: [PATCH] Add ui test for writing anyhow instead of bail Currently fails: Expected test case to fail to compile, but it succeeded. --- tests/ui/must-use.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/ui/must-use.rs diff --git a/tests/ui/must-use.rs b/tests/ui/must-use.rs new file mode 100644 index 0000000..ea4e58f --- /dev/null +++ b/tests/ui/must-use.rs @@ -0,0 +1,11 @@ +#![deny(unused_must_use)] + +use anyhow::anyhow; + +fn main() -> anyhow::Result<()> { + if true { + // meant to write bail! + anyhow!("it failed"); + } + Ok(()) +}