rust/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-in-test-should-panic.rs
2024-02-16 20:02:50 +00:00

16 lines
296 B
Rust

//@ compile-flags: --test
#![feature(test)]
extern crate test;
use std::num::ParseIntError;
use test::Bencher;
#[test]
#[should_panic]
fn not_a_num() -> Result<(), ParseIntError> {
//~^ ERROR functions using `#[should_panic]` must return `()`
let _: u32 = "abc".parse()?;
Ok(())
}