rust/tests/compile-fail/panic.rs

23 lines
311 B
Rust
Raw Normal View History

2015-12-23 15:37:52 -06:00
#![feature(plugin)]
#![plugin(clippy)]
#[deny(panic_params)]
fn missing() {
panic!("{}"); //~ERROR: You probably are missing some parameter
}
fn ok_sigle() {
panic!("foo bar");
}
fn ok_multiple() {
panic!("{}", "This is {ok}");
}
fn main() {
missing();
ok_sigle();
ok_multiple();
}