add expected output for try_err test

This commit is contained in:
yaxum62 2024-07-15 21:54:15 -07:00
parent fceeb13399
commit 1821defc39

View File

@ -1,5 +1,5 @@
//@aux-build:proc_macros.rs
#![feature(try_blocks)]
#![deny(clippy::try_err)]
#![allow(
clippy::unnecessary_wraps,
@ -152,3 +152,11 @@ pub fn try_return(x: bool) -> Result<i32, i32> {
}
Ok(0)
}
// Test that the lint is suppressed in try block.
pub fn try_block() -> Result<(), i32> {
let _: Result<_, i32> = try {
Err(1)?;
};
Ok(())
}