mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-12 08:36:03 +00:00
16 lines
295 B
Rust
16 lines
295 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(())
|
|
}
|