You can find the answer in testing section of the Rust book. More specifically, you want #[should_panic] attribute: #[test] #[should_panic] fn ...
確定! 回上一頁