Skip to content

Commit

Permalink
Add ui test for writing anyhow instead of bail
Browse files Browse the repository at this point in the history
Currently fails:

    Expected test case to fail to compile, but it succeeded.
  • Loading branch information
dtolnay committed Mar 7, 2022
1 parent 3ca5036 commit 06826d1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/ui/must-use.rs
Original file line number Diff line number Diff line change
@@ -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(())
}

0 comments on commit 06826d1

Please sign in to comment.