2018-02-08 17:16:39 -05:00
|
|
|
// compile-flags: --test
|
|
|
|
|
2018-02-22 20:16:30 -05:00
|
|
|
#![feature(test)]
|
2018-02-08 17:16:39 -05:00
|
|
|
|
2018-02-22 20:16:30 -05:00
|
|
|
extern crate test;
|
2018-02-08 17:16:39 -05:00
|
|
|
use std::num::ParseIntError;
|
2018-02-22 20:16:30 -05:00
|
|
|
use test::Bencher;
|
2018-02-08 17:16:39 -05:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
#[should_panic]
|
|
|
|
fn not_a_num() -> Result<(), ParseIntError> {
|
2018-04-12 12:30:37 -07:00
|
|
|
//~^ ERROR functions using `#[should_panic]` must return `()`
|
2018-02-22 20:16:30 -05:00
|
|
|
let _: u32 = "abc".parse()?;
|
|
|
|
Ok(())
|
|
|
|
}
|